mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-28 10:23:48 -07:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user