diff options
author | vaxerski <[email protected]> | 2022-11-20 18:38:53 +0000 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-11-20 18:38:53 +0000 |
commit | 254c3d166ffbcb33433c59ec6e00b139bb880c55 (patch) | |
tree | 17b2e39e11dbd68fcf33d3df883511aa0fa3fdc9 | |
parent | 137cf9e5825fbead1d78110cb16480ccb9105931 (diff) | |
download | Hyprland-254c3d166ffbcb33433c59ec6e00b139bb880c55.tar.gz Hyprland-254c3d166ffbcb33433c59ec6e00b139bb880c55.zip |
don't send motion events to lock constraints
-rw-r--r-- | src/managers/input/InputManager.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 2aa2f7a5..24bab360 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -89,6 +89,9 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { Vector2D hint = { PCONSTRAINT->current.cursor_hint.x, PCONSTRAINT->current.cursor_hint.y }; wlr_cursor_warp_closest(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sSeat.mouse->mouse, CONSTRAINTPOS.x + hint.x, CONSTRAINTPOS.y + hint.y); + + return; // don't process anything else, the cursor is locked. The surface should not receive any further events. + // these are usually FPS games. They will use the relative motion. } else { // we restrict the cursor to the confined region if (!pixman_region32_contains_point(&PCONSTRAINT->region, mouseCoords.x - CONSTRAINTPOS.x, mouseCoords.y - CONSTRAINTPOS.y, nullptr)) { |