[app] core: place the local cursor inside the window on capture

This commit is contained in:
Geoffrey McRae 2025-03-07 12:21:20 +11:00
parent 968fd42d46
commit 7c285a45fb

View File

@ -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();