From e74a9bc3af89d0de4043783996a3a5f4b97786bd Mon Sep 17 00:00:00 2001 From: Jeremy Huang Date: Tue, 2 Apr 2024 01:51:38 -0700 Subject: [PATCH 1/2] fix mouse simulation switching focusedmon --- src/managers/input/InputManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index cb14f4b113b..b1b2aa83229 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -196,7 +196,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { g_pLayoutManager->getCurrentLayout()->onMouseMove(getMouseCoordsInternal()); - if (PMONITOR && PMONITOR != g_pCompositor->m_pLastMonitor && (*PMOUSEFOCUSMON || refocus)) + if (PMONITOR && PMONITOR != g_pCompositor->m_pLastMonitor && (*PMOUSEFOCUSMON || refocus) && !m_pForcedFocus) g_pCompositor->setActiveMonitor(PMONITOR); if (g_pSessionLockManager->isSessionLocked()) { From 30050d77f6e46ebe5cbd05ff883fbea487652f62 Mon Sep 17 00:00:00 2001 From: Jeremy Huang Date: Sat, 6 Apr 2024 14:35:58 -0700 Subject: [PATCH 2/2] fix some warnings with wrong enum --- src/managers/input/InputManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index b1b2aa83229..05317281a37 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -624,7 +624,7 @@ void CInputManager::processMouseDownNormal(wlr_pointer_button_event* e) { } switch (e->state) { - case WLR_BUTTON_PRESSED: + case WL_POINTER_BUTTON_STATE_PRESSED: if (*PFOLLOWMOUSE == 3) // don't refocus on full loose break; @@ -646,7 +646,7 @@ void CInputManager::processMouseDownNormal(wlr_pointer_button_event* e) { g_pCompositor->changeWindowZOrder(g_pCompositor->m_pLastWindow, true); break; - case WLR_BUTTON_RELEASED: break; + case WL_POINTER_BUTTON_STATE_RELEASED: break; } // notify app if we didnt handle it @@ -659,7 +659,7 @@ void CInputManager::processMouseDownNormal(wlr_pointer_button_event* e) { void CInputManager::processMouseDownKill(wlr_pointer_button_event* e) { switch (e->state) { - case WLR_BUTTON_PRESSED: { + case WL_POINTER_BUTTON_STATE_PRESSED: { const auto PWINDOW = g_pCompositor->vectorToWindowUnified(getMouseCoordsInternal(), RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING); if (!PWINDOW) { @@ -671,7 +671,7 @@ void CInputManager::processMouseDownKill(wlr_pointer_button_event* e) { kill(PWINDOW->getPID(), SIGKILL); break; } - case WLR_BUTTON_RELEASED: break; + case WL_POINTER_BUTTON_STATE_RELEASED: break; default: break; }