keybinds: unconstrain mouse on focusmonitor and cyclenext (#4863)

This commit is contained in:
JManch 2024-02-28 00:52:45 +00:00 committed by GitHub
parent 1c460e98f8
commit c198d744b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}