keybinds: fix previous workspace remembering (#12399)
* swipe: Fix previous workspace remembering in workspace gesture Fixes a bug that previous workspace does not exist after swiping to a workspace * tests: Test that `workspace previous` works after workspace gesture * moveActiveToWorkspace: remember previous workspace unconditionally
This commit is contained in:
parent
ebe74be75a
commit
222dbe99d0
3 changed files with 33 additions and 8 deletions
|
|
@ -1391,10 +1391,9 @@ SDispatchResult CKeybindManager::moveActiveToWorkspace(std::string args) {
|
|||
return {.success = false, .error = "Not moving to workspace because it didn't change."};
|
||||
}
|
||||
|
||||
auto pWorkspace = g_pCompositor->getWorkspaceByID(WORKSPACEID);
|
||||
PHLMONITOR pMonitor = nullptr;
|
||||
const auto POLDWS = PWINDOW->m_workspace;
|
||||
static auto PALLOWWORKSPACECYCLES = CConfigValue<Hyprlang::INT>("binds:allow_workspace_cycles");
|
||||
auto pWorkspace = g_pCompositor->getWorkspaceByID(WORKSPACEID);
|
||||
PHLMONITOR pMonitor = nullptr;
|
||||
const auto POLDWS = PWINDOW->m_workspace;
|
||||
|
||||
updateRelativeCursorCoords();
|
||||
|
||||
|
|
@ -1419,8 +1418,7 @@ SDispatchResult CKeybindManager::moveActiveToWorkspace(std::string args) {
|
|||
else if (POLDWS->m_isSpecialWorkspace)
|
||||
POLDWS->m_monitor.lock()->setSpecialWorkspace(nullptr);
|
||||
|
||||
if (*PALLOWWORKSPACECYCLES)
|
||||
pWorkspace->rememberPrevWorkspace(POLDWS);
|
||||
pWorkspace->rememberPrevWorkspace(POLDWS);
|
||||
|
||||
pMonitor->changeWorkspace(pWorkspace);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue