From 949b4fc349215eb8f6c16bffb92c2d0f4d4e5553 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 18 Jan 2024 15:10:16 -0500 Subject: [PATCH] x11: XI_Motion should mark the global mouse position as changed. Otherwise we'll miss it when XWarpPointer() is used. x11vnc may do this to manage mouse input in some circumstances, so it can be possible for _all_ mouse motion to go through this path, breaking SDL_GetGlobalMouseState(). Thanks to @chrismile for all the detective work to figure this out! Fixes #8827. (cherry picked from commit cc7fe8c255ca8f3b4f5407c0c70103b4c7ad8168) --- src/video/x11/SDL_x11xinput2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video/x11/SDL_x11xinput2.c b/src/video/x11/SDL_x11xinput2.c index 346130a34f..5003937125 100644 --- a/src/video/x11/SDL_x11xinput2.c +++ b/src/video/x11/SDL_x11xinput2.c @@ -436,6 +436,8 @@ int X11_HandleXinput2Event(SDL_VideoDevice *_this, XGenericEventCookie *cookie) int pointer_emulated = (xev->flags & XIPointerEmulated); #endif /* SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH */ + videodata->global_mouse_changed = SDL_TRUE; + if (xev->deviceid != xev->sourceid) { /* Discard events from "Master" devices to avoid duplicates. */ return 1;