compositor: fix new workspace being lost in moveWorkspaceToMonitor

with the move to refcounting workspaces, createNewWorkspace would've lost the ref

fixes #11385
This commit is contained in:
vaxerski 2025-08-17 20:29:01 +02:00
parent 0840103ae0
commit e8731883a5

View file

@ -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);