From 31cc7f3b87d1d9670b66e73e3720da2e2da49acd Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Thu, 24 Jul 2025 00:36:29 +0200 Subject: core: move workspace ptrs to weak (#11194) Fixes some race conditions that come up in tests. We only clean up workspaces when we render a frame. With this, they are always cleared instantly. --- src/render/Renderer.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/render/Renderer.cpp') diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index e09de913..918a6e94 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -941,14 +941,14 @@ void CHyprRenderer::renderAllClientsForWorkspace(PHLMONITOR pMonitor, PHLWORKSPA } // special - for (auto const& ws : g_pCompositor->m_workspaces) { + for (auto const& ws : g_pCompositor->getWorkspaces()) { if (ws->m_alpha->value() <= 0.F || !ws->m_isSpecialWorkspace) continue; if (ws->m_hasFullscreenWindow) - renderWorkspaceWindowsFullscreen(pMonitor, ws, time); + renderWorkspaceWindowsFullscreen(pMonitor, ws.lock(), time); else - renderWorkspaceWindows(pMonitor, ws, time); + renderWorkspaceWindows(pMonitor, ws.lock(), time); } // pinned always above @@ -1225,7 +1225,6 @@ void CHyprRenderer::renderMonitor(PHLMONITOR pMonitor, bool commit) { if (pMonitor->m_id == m_mostHzMonitor->m_id || *PVFR == 1) { // unfortunately with VFR we don't have the guarantee mostHz is going to be updated all the time, so we have to ignore that - g_pCompositor->sanityCheckWorkspaces(); g_pConfigManager->dispatchExecOnce(); // We exec-once when at least one monitor starts refreshing, meaning stuff has init'd @@ -2192,7 +2191,7 @@ void CHyprRenderer::recheckSolitaryForMonitor(PHLMONITOR pMonitor) { if (pMonitor->m_activeSpecialWorkspace) return; - for (auto const& ws : g_pCompositor->m_workspaces) { + for (auto const& ws : g_pCompositor->getWorkspaces()) { if (ws->m_alpha->value() <= 0.F || !ws->m_isSpecialWorkspace || ws->m_monitor != pMonitor) continue; -- cgit v1.2.3