From 05dd204c5feddd18084a4ae5e4747579b0728a23 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 5 Mar 2024 20:46:08 +0000 Subject: [PATCH] window: ignore surface updates in unsafe / on invalid monitors --- src/Window.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Window.cpp b/src/Window.cpp index 6444aced..41562291 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -336,7 +336,7 @@ void sendLeaveIter(wlr_surface* pSurface, int x, int y, void* data) { } void CWindow::updateSurfaceScaleTransformDetails() { - if (!m_bIsMapped || m_bHidden) + if (!m_bIsMapped || m_bHidden || g_pCompositor->m_bUnsafeState) return; const auto PLASTMONITOR = g_pCompositor->getMonitorFromID(m_iLastSurfaceMonitorID); @@ -345,6 +345,9 @@ void CWindow::updateSurfaceScaleTransformDetails() { const auto PNEWMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID); + if (!PNEWMONITOR) + return; + if (PNEWMONITOR != PLASTMONITOR) { if (PLASTMONITOR && PLASTMONITOR->m_bEnabled) wlr_surface_for_each_surface(m_pWLSurface.wlr(), sendLeaveIter, PLASTMONITOR->output);