From 6b92144f15117f9f7d93fe9867d6ec849d9abce1 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Thu, 11 Jan 2024 13:15:20 +0100 Subject: surface: avoid spam of window surfaces with scale and transform events fixes #4408 --- src/Window.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Window.cpp') 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); -- cgit v1.2.3