浏览代码

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.
Ryan C. Gordon 2 年之前
父节点
当前提交
cc7fe8c255
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/video/x11/SDL_x11xinput2.c

+ 2 - 0
src/video/x11/SDL_x11xinput2.c

@@ -337,6 +337,8 @@ int X11_HandleXinput2Event(SDL_VideoData *videodata, XGenericEventCookie *cookie
         const XIDeviceEvent *xev = (const XIDeviceEvent *)cookie->data;
         const XIDeviceEvent *xev = (const XIDeviceEvent *)cookie->data;
         int pointer_emulated = (xev->flags & XIPointerEmulated);
         int pointer_emulated = (xev->flags & XIPointerEmulated);
 
 
+        videodata->global_mouse_changed = SDL_TRUE;
+
         if (!pointer_emulated) {
         if (!pointer_emulated) {
             SDL_Mouse *mouse = SDL_GetMouse();
             SDL_Mouse *mouse = SDL_GetMouse();
             if (!mouse->relative_mode || mouse->relative_mode_warp) {
             if (!mouse->relative_mode || mouse->relative_mode_warp) {