Skip to content

Commit

Permalink
refactor: use rememberPrevWorkspace
Browse files Browse the repository at this point in the history
  • Loading branch information
memchr committed Sep 11, 2023
1 parent 4c7ceed commit d752710
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/managers/KeybindManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,11 +865,11 @@ void CKeybindManager::changeworkspace(std::string args) {

if (BISWORKSPACECURRENT) {
if (*PALLOWWORKSPACECYCLES)
pWorkspaceToChangeTo->m_sPrevWorkspace = {PCURRENTWORKSPACE->m_iID, PCURRENTWORKSPACE->m_szName};
pWorkspaceToChangeTo->rememberPrevWorkspace(PCURRENTWORKSPACE);
else if (!EXPLICITPREVIOUS)
pWorkspaceToChangeTo->m_sPrevWorkspace = {-1, ""};
pWorkspaceToChangeTo->rememberPrevWorkspace(nullptr);
} else
pWorkspaceToChangeTo->m_sPrevWorkspace = {PCURRENTWORKSPACE->m_iID, PCURRENTWORKSPACE->m_szName};
pWorkspaceToChangeTo->rememberPrevWorkspace(PCURRENTWORKSPACE);

if (auto PLASTWINDOW = pWorkspaceToChangeTo->getLastFocusedWindow(); PLASTWINDOW && *PFOLLOWMOUSE == 1)
g_pCompositor->warpCursorTo(PLASTWINDOW->middle());
Expand Down Expand Up @@ -942,7 +942,7 @@ void CKeybindManager::moveActiveToWorkspace(std::string args) {
g_pCompositor->warpCursorTo(PWINDOW->middle());

if (*PALLOWWORKSPACECYCLES)
pWorkspace->m_sPrevWorkspace = {POLDWS->m_iID, POLDWS->m_szName};
pWorkspace->rememberPrevWorkspace(POLDWS);
}

void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) {
Expand Down

0 comments on commit d752710

Please sign in to comment.