summaryrefslogtreecommitdiff
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2025-08-17 20:29:01 +0200
committervaxerski <vaxry@vaxry.net>2025-08-17 20:33:04 +0200
commite8731883a550ceae1bdfd5547f6083a5fcaf6509 (patch)
tree79c9201795d8b0e6cc6d757b78ed4be65958f35b /src/Compositor.cpp
parent0840103ae06e9d6ab4a8692ff18dc45e2e95e5c9 (diff)
compositor: fix new workspace being lost in moveWorkspaceToMonitor
with the move to refcounting workspaces, createNewWorkspace would've lost the ref fixes #11385
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 7b6a9e08..b06710f6 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -2142,6 +2142,8 @@ void CCompositor::moveWorkspaceToMonitor(PHLWORKSPACE pWorkspace, PHLMONITOR pMo
if (!SWITCHINGISACTIVE)
nextWorkspaceOnMonitorID = pWorkspace->m_id;
else {
+ PHLWORKSPACE newWorkspace; // for holding a ref to the new workspace that might be created
+
for (auto const& w : getWorkspaces()) {
if (w->m_monitor == POLDMON && w->m_id != pWorkspace->m_id && !w->m_isSpecialWorkspace) {
nextWorkspaceOnMonitorID = w->m_id;
@@ -2161,7 +2163,7 @@ void CCompositor::moveWorkspaceToMonitor(PHLWORKSPACE pWorkspace, PHLMONITOR pMo
Debug::log(LOG, "moveWorkspaceToMonitor: Plugging gap with new {}", nextWorkspaceOnMonitorID);
if (POLDMON)
- g_pCompositor->createNewWorkspace(nextWorkspaceOnMonitorID, POLDMON->m_id);
+ newWorkspace = g_pCompositor->createNewWorkspace(nextWorkspaceOnMonitorID, POLDMON->m_id);
}
Debug::log(LOG, "moveWorkspaceToMonitor: Plugging gap with existing {}", nextWorkspaceOnMonitorID);