diff options
author | virchau13 <[email protected]> | 2024-01-15 23:30:46 +0800 |
---|---|---|
committer | GitHub <[email protected]> | 2024-01-15 16:30:46 +0100 |
commit | 3c964a9fdc220250a85b1c498e5b6fad9390272f (patch) | |
tree | 7bd1b78108c75497244e53c6d8df674866cf4f39 /src/Compositor.cpp | |
parent | f14c5ea5c56858260c1133d8003fc5961ace373d (diff) | |
download | Hyprland-3c964a9fdc220250a85b1c498e5b6fad9390272f.tar.gz Hyprland-3c964a9fdc220250a85b1c498e5b6fad9390272f.zip |
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
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r-- | src/Compositor.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index b37e25b2..8d16f22d 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2114,7 +2114,7 @@ CMonitor* CCompositor::getMonitorFromString(const std::string& name) { return nullptr; } -void CCompositor::moveWorkspaceToMonitor(CWorkspace* pWorkspace, CMonitor* pMonitor) { +void CCompositor::moveWorkspaceToMonitor(CWorkspace* pWorkspace, CMonitor* pMonitor, bool noWarpCursor) { // We trust the workspace and monitor to be correct. @@ -2200,7 +2200,8 @@ void CCompositor::moveWorkspaceToMonitor(CWorkspace* pWorkspace, CMonitor* pMoni pWorkspace->startAnim(true, true, true); - wlr_cursor_warp(m_sWLRCursor, nullptr, pMonitor->vecPosition.x + pMonitor->vecTransformedSize.x / 2, pMonitor->vecPosition.y + pMonitor->vecTransformedSize.y / 2); + if (!noWarpCursor) + wlr_cursor_warp(m_sWLRCursor, nullptr, pMonitor->vecPosition.x + pMonitor->vecTransformedSize.x / 2, pMonitor->vecPosition.y + pMonitor->vecTransformedSize.y / 2); g_pInputManager->sendMotionEventsToFocused(); } |