From 7c285a45fb533048bcba18fe8712a800aa3a11e0 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 7 Mar 2025 12:21:20 +1100 Subject: [PATCH] [app] core: place the local cursor inside the window on capture --- client/src/core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/src/core.c b/client/src/core.c index 3319f4ff..0cb4bde6 100644 --- a/client/src/core.c +++ b/client/src/core.c @@ -141,6 +141,13 @@ void core_setGrabQuiet(bool enable) core_setCursorInView(true); g_state.ignoreInput = false; + /* ensure the local mouse is inside the window before we capture, this fixes + * odd UI behaviour if the user is using focus follows mouse and the window + * was focused without the cursor being in window already */ + struct DoublePoint local; + util_guestCurToLocal(&local); + core_warpPointer(local.x, local.y, true); + if (g_params.grabKeyboard) g_state.ds->grabKeyboard();