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:
parent
0840103ae0
commit
e8731883a5
1 changed files with 3 additions and 1 deletions
|
|
@ -2142,6 +2142,8 @@ void CCompositor::moveWorkspaceToMonitor(PHLWORKSPACE pWorkspace, PHLMONITOR pMo
|
||||||
if (!SWITCHINGISACTIVE)
|
if (!SWITCHINGISACTIVE)
|
||||||
nextWorkspaceOnMonitorID = pWorkspace->m_id;
|
nextWorkspaceOnMonitorID = pWorkspace->m_id;
|
||||||
else {
|
else {
|
||||||
|
PHLWORKSPACE newWorkspace; // for holding a ref to the new workspace that might be created
|
||||||
|
|
||||||
for (auto const& w : getWorkspaces()) {
|
for (auto const& w : getWorkspaces()) {
|
||||||
if (w->m_monitor == POLDMON && w->m_id != pWorkspace->m_id && !w->m_isSpecialWorkspace) {
|
if (w->m_monitor == POLDMON && w->m_id != pWorkspace->m_id && !w->m_isSpecialWorkspace) {
|
||||||
nextWorkspaceOnMonitorID = w->m_id;
|
nextWorkspaceOnMonitorID = w->m_id;
|
||||||
|
|
@ -2161,7 +2163,7 @@ void CCompositor::moveWorkspaceToMonitor(PHLWORKSPACE pWorkspace, PHLMONITOR pMo
|
||||||
Debug::log(LOG, "moveWorkspaceToMonitor: Plugging gap with new {}", nextWorkspaceOnMonitorID);
|
Debug::log(LOG, "moveWorkspaceToMonitor: Plugging gap with new {}", nextWorkspaceOnMonitorID);
|
||||||
|
|
||||||
if (POLDMON)
|
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);
|
Debug::log(LOG, "moveWorkspaceToMonitor: Plugging gap with existing {}", nextWorkspaceOnMonitorID);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue