summaryrefslogtreecommitdiff
path: root/src/helpers/Monitor.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-04-14 15:28:22 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-04-14 15:28:22 +0100
commit727160f0a4ef08dbcd543f1ffca64c6de30c9c44 (patch)
tree95bc62cf0e658fded1603659b87499c6c038e0c9 /src/helpers/Monitor.cpp
parent3f2a18a4352bcf418d8a4645155f51904fdb4a47 (diff)
workspaces: fixup workspaces not activating on workspace switch
Diffstat (limited to 'src/helpers/Monitor.cpp')
-rw-r--r--src/helpers/Monitor.cpp12
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);