diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 3cad4dcf..b2d9ab57 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -703,9 +703,9 @@ CWindow* CCompositor::getWindowInDirection(CWindow* pWindow, char dir) { return nullptr; } -void CCompositor::deactivateAllWLRWorkspaces() { +void CCompositor::deactivateAllWLRWorkspaces(wlr_ext_workspace_handle_v1* exclude) { for (auto& w : m_lWorkspaces) { - if (w.m_pWlrHandle) + if (w.m_pWlrHandle && w.m_pWlrHandle != exclude) wlr_ext_workspace_handle_v1_set_active(w.m_pWlrHandle, false); } } diff --git a/src/Compositor.hpp b/src/Compositor.hpp index f91772a8..d4d9ffcd 100644 --- a/src/Compositor.hpp +++ b/src/Compositor.hpp @@ -108,7 +108,7 @@ public: void moveWindowToTop(CWindow*); void cleanupWindows(); CWindow* getWindowInDirection(CWindow*, char); - void deactivateAllWLRWorkspaces(); + void deactivateAllWLRWorkspaces(wlr_ext_workspace_handle_v1* exclude = nullptr); CWindow* getNextWindowOnWorkspace(CWindow*); int getNextAvailableNamedWorkspace(); bool isPointOnAnyMonitor(const Vector2D&); diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp index 3f1d38e1..ab2caa3d 100644 --- a/src/events/Monitors.cpp +++ b/src/events/Monitors.cpp @@ -113,7 +113,7 @@ void Events::listener_newOutput(wl_listener* listener, void* data) { PNEWMONITOR->scale = monitorRule.scale; - g_pCompositor->deactivateAllWLRWorkspaces(); + g_pCompositor->deactivateAllWLRWorkspaces(PNEWWORKSPACE->m_pWlrHandle); wlr_ext_workspace_handle_v1_set_active(PNEWWORKSPACE->m_pWlrHandle, true); if (!pMostHzMonitor || monitorRule.refreshRate > pMostHzMonitor->refreshRate) diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp index eacf7e40..2853924d 100644 --- a/src/managers/InputManager.cpp +++ b/src/managers/InputManager.cpp @@ -43,7 +43,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { wlr_ext_workspace_group_handle_v1_output_enter(PMONITOR->pWLRWorkspaceGroupHandle, PMONITOR->output); // set active workspace and deactivate all other in wlr - g_pCompositor->deactivateAllWLRWorkspaces(); + g_pCompositor->deactivateAllWLRWorkspaces(g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace)->m_pWlrHandle); wlr_ext_workspace_handle_v1_set_active(g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace)->m_pWlrHandle, true); } diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 8a503005..7e7b4079 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -214,7 +214,7 @@ void CKeybindManager::changeworkspace(std::string args) { g_pCompositor->focusWindow(g_pCompositor->getFirstWindowOnWorkspace(workspaceToChangeTo)); // set active and deactivate all other in wlr - g_pCompositor->deactivateAllWLRWorkspaces(); + g_pCompositor->deactivateAllWLRWorkspaces(g_pCompositor->getWorkspaceByID(workspaceToChangeTo)->m_pWlrHandle); wlr_ext_workspace_handle_v1_set_active(g_pCompositor->getWorkspaceByID(workspaceToChangeTo)->m_pWlrHandle, true); Debug::log(LOG, "Changed to workspace %i", workspaceToChangeTo); @@ -247,7 +247,7 @@ void CKeybindManager::changeworkspace(std::string args) { g_pCompositor->fixXWaylandWindowsOnWorkspace(OLDWORKSPACE); // set active and deactivate all other - g_pCompositor->deactivateAllWLRWorkspaces(); + g_pCompositor->deactivateAllWLRWorkspaces(PWORKSPACE->m_pWlrHandle); wlr_ext_workspace_handle_v1_set_active(PWORKSPACE->m_pWlrHandle, true); // mark the monitor dirty