surface: avoid spam of window surfaces with scale and transform events
fixes #4408
This commit is contained in:
parent
8d31c84483
commit
6b92144f15
6 changed files with 40 additions and 7 deletions
|
|
@ -366,7 +366,12 @@ void CWindow::updateSurfaceScaleTransformDetails() {
|
|||
m_pWLSurface.wlr(),
|
||||
[](wlr_surface* surf, int x, int y, void* data) {
|
||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(((CWindow*)data)->m_iMonitorID);
|
||||
g_pCompositor->setPreferredScaleForSurface(surf, PMONITOR ? PMONITOR->scale : 1.f);
|
||||
|
||||
const auto PSURFACE = CWLSurface::surfaceFromWlr(surf);
|
||||
if (PSURFACE && PSURFACE->m_fLastScale == PMONITOR->scale)
|
||||
return;
|
||||
|
||||
g_pCompositor->setPreferredScaleForSurface(surf, PMONITOR->scale);
|
||||
g_pCompositor->setPreferredTransformForSurface(surf, PMONITOR->transform);
|
||||
},
|
||||
this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue