mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-08-17 09:10:24 +03:00
internal: save previous workspace before change (#6202)
This commit is contained in:
parent
7ad9116de8
commit
25b9446949
@ -1071,6 +1071,14 @@ void CKeybindManager::changeworkspace(std::string args) {
|
|||||||
|
|
||||||
g_pCompositor->setActiveMonitor(PMONITORWORKSPACEOWNER);
|
g_pCompositor->setActiveMonitor(PMONITORWORKSPACEOWNER);
|
||||||
|
|
||||||
|
if (BISWORKSPACECURRENT) {
|
||||||
|
if (*PALLOWWORKSPACECYCLES)
|
||||||
|
pWorkspaceToChangeTo->rememberPrevWorkspace(PCURRENTWORKSPACE);
|
||||||
|
else if (!EXPLICITPREVIOUS && !*PBACKANDFORTH)
|
||||||
|
pWorkspaceToChangeTo->rememberPrevWorkspace(nullptr);
|
||||||
|
} else
|
||||||
|
pWorkspaceToChangeTo->rememberPrevWorkspace(PCURRENTWORKSPACE);
|
||||||
|
|
||||||
PMONITORWORKSPACEOWNER->changeWorkspace(pWorkspaceToChangeTo, false, true);
|
PMONITORWORKSPACEOWNER->changeWorkspace(pWorkspaceToChangeTo, false, true);
|
||||||
|
|
||||||
if (PMONITOR != PMONITORWORKSPACEOWNER) {
|
if (PMONITOR != PMONITORWORKSPACEOWNER) {
|
||||||
@ -1083,14 +1091,6 @@ void CKeybindManager::changeworkspace(std::string args) {
|
|||||||
g_pCompositor->warpCursorTo(middle);
|
g_pCompositor->warpCursorTo(middle);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BISWORKSPACECURRENT) {
|
|
||||||
if (*PALLOWWORKSPACECYCLES)
|
|
||||||
pWorkspaceToChangeTo->rememberPrevWorkspace(PCURRENTWORKSPACE);
|
|
||||||
else if (!EXPLICITPREVIOUS && !*PBACKANDFORTH)
|
|
||||||
pWorkspaceToChangeTo->rememberPrevWorkspace(nullptr);
|
|
||||||
} else
|
|
||||||
pWorkspaceToChangeTo->rememberPrevWorkspace(PCURRENTWORKSPACE);
|
|
||||||
|
|
||||||
if (!g_pInputManager->m_bLastFocusOnLS) {
|
if (!g_pInputManager->m_bLastFocusOnLS) {
|
||||||
if (g_pCompositor->m_pLastFocus)
|
if (g_pCompositor->m_pLastFocus)
|
||||||
g_pInputManager->sendMotionEventsToFocused();
|
g_pInputManager->sendMotionEventsToFocused();
|
||||||
@ -1163,13 +1163,13 @@ void CKeybindManager::moveActiveToWorkspace(std::string args) {
|
|||||||
else if (POLDWS->m_bIsSpecialWorkspace)
|
else if (POLDWS->m_bIsSpecialWorkspace)
|
||||||
g_pCompositor->getMonitorFromID(POLDWS->m_iMonitorID)->setSpecialWorkspace(nullptr);
|
g_pCompositor->getMonitorFromID(POLDWS->m_iMonitorID)->setSpecialWorkspace(nullptr);
|
||||||
|
|
||||||
|
if (*PALLOWWORKSPACECYCLES)
|
||||||
|
pWorkspace->rememberPrevWorkspace(POLDWS);
|
||||||
|
|
||||||
pMonitor->changeWorkspace(pWorkspace);
|
pMonitor->changeWorkspace(pWorkspace);
|
||||||
|
|
||||||
g_pCompositor->focusWindow(PWINDOW);
|
g_pCompositor->focusWindow(PWINDOW);
|
||||||
g_pCompositor->warpCursorTo(PWINDOW->middle());
|
g_pCompositor->warpCursorTo(PWINDOW->middle());
|
||||||
|
|
||||||
if (*PALLOWWORKSPACECYCLES)
|
|
||||||
pWorkspace->rememberPrevWorkspace(POLDWS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) {
|
void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) {
|
||||||
|
Loading…
Reference in New Issue
Block a user