diff options
Diffstat (limited to 'src/helpers/Monitor.cpp')
| -rw-r--r-- | src/helpers/Monitor.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 3fa2ebb8..47bb9317 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -477,9 +477,17 @@ float CMonitor::getDefaultScale() { } void CMonitor::changeWorkspace(CWorkspace* const pWorkspace, bool internal) { - if (!pWorkspace || pWorkspace->m_iID == activeWorkspace) + if (!pWorkspace) return; + if (pWorkspace->m_iID == activeWorkspace) { + // in some cases (e.g. workspace from one monitor to another) + // we need to send this + g_pCompositor->deactivateAllWLRWorkspaces(pWorkspace->m_pWlrHandle); + pWorkspace->setActive(true); + return; + } + if (pWorkspace->m_bIsSpecialWorkspace) { Debug::log(ERR, "BUG THIS: Attempted to changeWorkspace to special!"); return; @@ -509,7 +517,7 @@ void CMonitor::changeWorkspace(CWorkspace* const pWorkspace, bool internal) { } // set some flags and fire event - g_pCompositor->deactivateAllWLRWorkspaces(); + g_pCompositor->deactivateAllWLRWorkspaces(pWorkspace->m_pWlrHandle); pWorkspace->setActive(true); g_pEventManager->postEvent(SHyprIPCEvent{"workspace", pWorkspace->m_szName}); EMIT_HOOK_EVENT("workspace", pWorkspace); |
