mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 04:09:49 +01:00
keybinds: remember last workspace on focusmonitor
This commit is contained in:
parent
4b52c1e68f
commit
606cb2832a
1 changed files with 11 additions and 0 deletions
|
@ -1394,7 +1394,18 @@ void CKeybindManager::focusMonitor(std::string arg) {
|
||||||
if (!PMONITOR || PMONITOR == g_pCompositor->m_pLastMonitor)
|
if (!PMONITOR || PMONITOR == g_pCompositor->m_pLastMonitor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace);
|
||||||
|
|
||||||
changeworkspace("[internal]" + std::to_string(PMONITOR->activeWorkspace));
|
changeworkspace("[internal]" + std::to_string(PMONITOR->activeWorkspace));
|
||||||
|
|
||||||
|
// remember last workspace (internal calls don't preserve it)
|
||||||
|
|
||||||
|
const auto PNEWWORKSPACE = g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace);
|
||||||
|
if (PNEWWORKSPACE == PWORKSPACE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
PNEWWORKSPACE->m_sPrevWorkspace.iID = PWORKSPACE->m_iID;
|
||||||
|
PNEWWORKSPACE->m_sPrevWorkspace.name = PWORKSPACE->m_szName;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CKeybindManager::moveCursorToCorner(std::string arg) {
|
void CKeybindManager::moveCursorToCorner(std::string arg) {
|
||||||
|
|
Loading…
Reference in a new issue