From 3dc2277fd05cbb71b858698fed749070a63aa392 Mon Sep 17 00:00:00 2001 From: SebOuellette Date: Tue, 21 Jun 2022 02:23:57 -0400 Subject: [PATCH] Actually, mostly working. One failure case: When there is a fullscreen window directly to the right of a game, for example, in a multimonitor setup, then the cursor will bug out in between the monitors. sometimes it will get constrained to the border, but just outside the window (which is what this PR fixes, so it's unusual) and sometimes the cursor will just ignore the constraint entirely. However this is only in the one case. --- 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 a6dd64249..a388fba94 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -50,7 +50,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { const auto CONSTRAINTPOS = CONSTRAINTWINDOW->m_bIsX11 ? Vector2D(CONSTRAINTWINDOW->m_uSurface.xwayland->x, CONSTRAINTWINDOW->m_uSurface.xwayland->y) : CONSTRAINTWINDOW->m_vRealPosition.vec(); const auto CONSTRAINTSIZE = CONSTRAINTWINDOW->m_bIsX11 ? Vector2D(CONSTRAINTWINDOW->m_uSurface.xwayland->width, CONSTRAINTWINDOW->m_uSurface.xwayland->height) : CONSTRAINTWINDOW->m_vRealSize.vec(); - if (!VECINRECT(mouseCoords, CONSTRAINTPOS.x, CONSTRAINTPOS.y, CONSTRAINTPOS.x + CONSTRAINTSIZE.x, CONSTRAINTPOS.y + CONSTRAINTSIZE.y)) { + if (!VECINRECT(mouseCoords, CONSTRAINTPOS.x, CONSTRAINTPOS.y, CONSTRAINTPOS.x + CONSTRAINTSIZE.x - 1.0, CONSTRAINTPOS.y + CONSTRAINTSIZE.y - 1.0)) { if (g_pCompositor->m_sSeat.mouse->constraintActive) { Vector2D newConstrainedCoords = mouseCoords;