mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-07-30 19:51:55 -07:00
keybinds: Add dispatcher for xmonad/qtile-style workspace switching (#4439)
* feat: implement xmonad/qtile-style workspace switching Implements the focusWorkspaceOnCurrentMonitor dispatcher and function, which implements XMonad/Qtile-style workspace switching. When called, focusWorkspaceOnCurrentMonitor will: 1. Send the requested workspace to the current monitor, 2. If the workspace was previously active on a different monitor, replace it with the workspace that was previously active on the current monitor, 3. Focus the workspace on the current monitor. * fix: address PR comments
This commit is contained in:
@@ -502,7 +502,7 @@ float CMonitor::getDefaultScale() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void CMonitor::changeWorkspace(CWorkspace* const pWorkspace, bool internal, bool noMouseMove) {
|
||||
void CMonitor::changeWorkspace(CWorkspace* const pWorkspace, bool internal, bool noMouseMove, bool noFocus) {
|
||||
if (!pWorkspace)
|
||||
return;
|
||||
|
||||
@@ -533,7 +533,7 @@ void CMonitor::changeWorkspace(CWorkspace* const pWorkspace, bool internal, bool
|
||||
}
|
||||
}
|
||||
|
||||
if (!g_pCompositor->m_pLastMonitor->specialWorkspaceID) {
|
||||
if (!noFocus && !g_pCompositor->m_pLastMonitor->specialWorkspaceID) {
|
||||
static auto* const PFOLLOWMOUSE = &g_pConfigManager->getConfigValuePtr("input:follow_mouse")->intValue;
|
||||
CWindow* pWindow = pWorkspace->getLastFocusedWindow();
|
||||
|
||||
|
Reference in New Issue
Block a user