core: Fix double special workspace (#5574)

* fix double special name

* fix special on another monitor

* remove extra stuff
This commit is contained in:
thejch 2024-04-13 06:39:20 -07:00 committed by GitHub
parent 582d6233c8
commit d96501442f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -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;
}

View file

@ -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;
}