keybinds: Better handling of workspace_back_and_forth (#4952)

* Removed redundant boolean condition

* Better handling of workspace_back_and_forth when using focusworkspaceoncurrentmonitor dispatcher

* Fixed config acquisition

---------

Co-authored-by: Tom Benham <tom.benham@quadrille.fr>
This commit is contained in:
Tom Benham
2024-03-04 18:05:20 +01:00
committed by GitHub
parent 12da0fc84f
commit 07c7235b72
2 changed files with 28 additions and 12 deletions

View File

@@ -2042,6 +2042,9 @@ void CCompositor::swapActiveWorkspaces(CMonitor* pMonitorA, CMonitor* pMonitorB)
pMonitorA->activeWorkspace = PWORKSPACEB->m_iID;
pMonitorB->activeWorkspace = PWORKSPACEA->m_iID;
PWORKSPACEA->rememberPrevWorkspace(PWORKSPACEB);
PWORKSPACEB->rememberPrevWorkspace(PWORKSPACEA);
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(pMonitorA->ID);
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(pMonitorB->ID);
@@ -2150,7 +2153,7 @@ void CCompositor::moveWorkspaceToMonitor(CWorkspace* pWorkspace, CMonitor* pMoni
// fix old mon
int nextWorkspaceOnMonitorID = -1;
if (!SWITCHINGISACTIVE || !POLDMON)
if (!SWITCHINGISACTIVE)
nextWorkspaceOnMonitorID = pWorkspace->m_iID;
else {
for (auto& w : m_vWorkspaces) {