From d119513749daf47b9061258a1974b34111ab8bb5 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 23 Apr 2024 21:15:37 +0100 Subject: [PATCH] renderer: fix safety around sendFrameEventsToWorkspace ref #5718 --- src/render/Renderer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 8b6be201..4b1e7ace 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1425,7 +1425,7 @@ void CHyprRenderer::renderWorkspace(CMonitor* pMonitor, PHLWORKSPACE pWorkspace, void CHyprRenderer::sendFrameEventsToWorkspace(CMonitor* pMonitor, PHLWORKSPACE pWorkspace, timespec* now) { for (auto& w : g_pCompositor->m_vWindows) { - if (w->isHidden() && !w->m_bIsMapped && !w->m_bFadingOut) + if (w->isHidden() || !w->m_bIsMapped || w->m_bFadingOut || !w->m_pWLSurface.wlr()) continue; if (!shouldRenderWindow(w.get(), pMonitor)) @@ -1437,6 +1437,9 @@ void CHyprRenderer::sendFrameEventsToWorkspace(CMonitor* pMonitor, PHLWORKSPACE for (auto& lsl : pMonitor->m_aLayerSurfaceLayers) { for (auto& ls : lsl) { + if (ls->fadingOut || !ls->surface.wlr()) + continue; + wlr_surface_for_each_surface( ls->surface.wlr(), [](wlr_surface* s, int x, int y, void* data) { wlr_surface_send_frame_done(s, (timespec*)data); }, now); }