mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-25 22:05:59 +01:00
keybinds: unconstrain mouse on focusmonitor and cyclenext (#4863)
This commit is contained in:
parent
1c460e98f8
commit
c198d744b7
1 changed files with 4 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue