From edd0a141de56cb71dc46ffdaf70fe0ccd950b136 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 25 Feb 2023 22:19:51 +0000 Subject: [PATCH] don't snap on empty hint --- src/managers/input/InputManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index d5c5acb1..e221651a 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -112,7 +112,8 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { Vector2D hint = {PCONSTRAINT->positionHint.x, PCONSTRAINT->positionHint.y}; - wlr_cursor_warp_closest(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sSeat.mouse->mouse, CONSTRAINTPOS.x + hint.x, CONSTRAINTPOS.y + hint.y); + if (hint != Vector2D{-1, -1}) + 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.