From 70eb74c356d291f4b5e048abef7772864a4f95f1 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 14 Apr 2023 01:36:07 +0100 Subject: [PATCH] fractional-scale: notify all surfaces on window move --- src/Window.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Window.cpp b/src/Window.cpp index 3942114b..ff1ddbcd 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -291,6 +291,17 @@ void CWindow::moveToWorkspace(int workspaceID) { if (PMONITOR) g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(m_pWLSurface.wlr(), PMONITOR->scale); + + if (!m_bIsMapped) + return; + + wlr_surface_for_each_surface( + m_pWLSurface.wlr(), + [](wlr_surface* surf, int x, int y, void* data) { + const auto PMONITOR = g_pCompositor->getMonitorFromID(((CWindow*)data)->m_iMonitorID); + g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(surf, PMONITOR ? PMONITOR->scale : 1.f); + }, + this); } CWindow* CWindow::X11TransientFor() {