From d96501442fb3bbec129e74e26f379898f15881e2 Mon Sep 17 00:00:00 2001 From: thejch <66577496+thejch@users.noreply.github.com> Date: Sat, 13 Apr 2024 06:39:20 -0700 Subject: [PATCH] core: Fix double special workspace (#5574) * fix double special name * fix special on another monitor * remove extra stuff --- src/Compositor.cpp | 5 ++++- src/helpers/Monitor.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 4ce4b097..47679169 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1008,7 +1008,10 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) { // This is to fix incorrect feedback on the focus history. PWORKSPACE->m_pLastFocusedWindow = pWindow; PWORKSPACE->rememberPrevWorkspace(m_pLastMonitor->activeWorkspace); - PMONITOR->changeWorkspace(PWORKSPACE, false, true); + if (PWORKSPACE->m_bIsSpecialWorkspace) + m_pLastMonitor->changeWorkspace(PWORKSPACE, false, true); // if special ws, open on current monitor + else + PMONITOR->changeWorkspace(PWORKSPACE, false, true); // changeworkspace already calls focusWindow return; } diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 196492c1..ceb021c8 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -545,7 +545,7 @@ void CMonitor::changeWorkspace(const PHLWORKSPACE& pWorkspace, bool internal, bo if (pWorkspace->m_bIsSpecialWorkspace) { if (activeSpecialWorkspace != pWorkspace) { Debug::log(LOG, "changeworkspace on special, togglespecialworkspace to id {}", pWorkspace->m_iID); - g_pKeybindManager->m_mDispatchers["togglespecialworkspace"](pWorkspace->m_szName == "special" ? "" : pWorkspace->m_szName); + setSpecialWorkspace(pWorkspace); } return; }