summaryrefslogtreecommitdiff
path: root/src/Window.cpp
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2024-01-11 13:15:20 +0100
committervaxerski <vaxry@vaxry.net>2024-01-11 14:07:28 +0100
commit6b92144f15117f9f7d93fe9867d6ec849d9abce1 (patch)
tree7513d63d76669a5cd84ea4b4a84470732c73560e /src/Window.cpp
parent8d31c84483be7cc6f909d73c6ecd4c0b4bdc3360 (diff)
surface: avoid spam of window surfaces with scale and transform events
fixes #4408
Diffstat (limited to 'src/Window.cpp')
-rw-r--r--src/Window.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Window.cpp b/src/Window.cpp
index 73835ccd..818b4089 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -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);