internal: prevent premature destroy in moveworkspace
This commit is contained in:
parent
33d06fb0e5
commit
41c7d896e3
2 changed files with 15 additions and 3 deletions
|
|
@ -1090,6 +1090,10 @@ CWorkspace* CCompositor::getWorkspaceByID(const int& id) {
|
|||
void CCompositor::sanityCheckWorkspaces() {
|
||||
auto it = m_vWorkspaces.begin();
|
||||
while (it != m_vWorkspaces.end()) {
|
||||
|
||||
if ((*it)->m_bIndestructible)
|
||||
continue;
|
||||
|
||||
const auto WINDOWSONWORKSPACE = getWindowsOnWorkspace((*it)->m_iID);
|
||||
|
||||
if ((*it)->m_bIsSpecialWorkspace && WINDOWSONWORKSPACE == 0) {
|
||||
|
|
@ -1884,9 +1888,13 @@ void CCompositor::moveWorkspaceToMonitor(CWorkspace* pWorkspace, CMonitor* pMoni
|
|||
|
||||
Debug::log(LOG, "moveWorkspaceToMonitor: Plugging gap with existing %d", nextWorkspaceOnMonitorID);
|
||||
|
||||
pWorkspace->m_bIndestructible = true; // so that changeworkspace doesn't yeet it if it's empty
|
||||
|
||||
g_pKeybindManager->focusMonitor(std::to_string(POLDMON->ID));
|
||||
g_pKeybindManager->changeworkspace(std::to_string(nextWorkspaceOnMonitorID));
|
||||
|
||||
pWorkspace->m_bIndestructible = false;
|
||||
|
||||
// move the workspace
|
||||
|
||||
pWorkspace->m_iMonitorID = pMonitor->ID;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue