summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorJManch <61563764+JManch@users.noreply.github.com>2024-02-28 00:52:45 +0000
committerGitHub <noreply@github.com>2024-02-28 00:52:45 +0000
commitc198d744b77f272c2fc187eb6d431580a99ab6c3 (patch)
treef6afad5a703176ab53350831afe3809ffbcfcb4c /src/managers/KeybindManager.cpp
parent1c460e98f870676b15871fe4e5bfeb1a32a3d6d8 (diff)
keybinds: unconstrain mouse on focusmonitor and cyclenext (#4863)
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 481b8987..58425757 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -234,6 +234,7 @@ bool CKeybindManager::tryMoveFocusToMonitor(CMonitor* monitor) {
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace);
const auto PNEWMAINWORKSPACE = g_pCompositor->getWorkspaceByID(monitor->activeWorkspace);
+ g_pInputManager->unconstrainMouse();
g_pCompositor->setActiveMonitor(monitor);
PNEWMAINWORKSPACE->rememberPrevWorkspace(PWORKSPACE);
@@ -257,6 +258,9 @@ void CKeybindManager::switchToWindow(CWindow* PWINDOWTOCHANGETO) {
if (PWINDOWTOCHANGETO == PLASTWINDOW || !PWINDOWTOCHANGETO)
return;
+ // remove constraints
+ g_pInputManager->unconstrainMouse();
+
if (PLASTWINDOW && PLASTWINDOW->m_iWorkspaceID == PWINDOWTOCHANGETO->m_iWorkspaceID && PLASTWINDOW->m_bIsFullscreen) {
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PLASTWINDOW->m_iWorkspaceID);
const auto FSMODE = PWORKSPACE->m_efFullscreenMode;
@@ -1121,9 +1125,6 @@ void CKeybindManager::moveFocusTo(std::string args) {
return;
}
- // remove constraints
- g_pInputManager->unconstrainMouse();
-
const auto PWINDOWTOCHANGETO = **PFULLCYCLE && PLASTWINDOW->m_bIsFullscreen ?
(arg == 'd' || arg == 'b' || arg == 'r' ? g_pCompositor->getNextWindowOnWorkspace(PLASTWINDOW, true) : g_pCompositor->getPrevWindowOnWorkspace(PLASTWINDOW, true)) :
g_pCompositor->getWindowInDirection(PLASTWINDOW, arg);
@@ -1158,9 +1159,6 @@ void CKeybindManager::focusUrgentOrLast(std::string args) {
if (!PWINDOWURGENT && !PWINDOWPREV)
return;
- // remove constraints
- g_pInputManager->unconstrainMouse();
-
switchToWindow(PWINDOWURGENT ? PWINDOWURGENT : PWINDOWPREV);
}
@@ -1171,9 +1169,6 @@ void CKeybindManager::focusCurrentOrLast(std::string args) {
if (!PWINDOWPREV)
return;
- // remove constraints
- g_pInputManager->unconstrainMouse();
-
switchToWindow(PWINDOWPREV);
}