Commit 7d55ccb8b04f2b1d88a959a55a51bb788fc531f4

Lauri Kasanen 2023-02-19T16:04:47

Fix GetGlobalMouseState when xi2 is not available at runtime (cherry picked from commit 0123d6311d5c0059d617324426ef7eef8d577d9b)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c
index 786e219..978a305 100644
--- a/src/video/x11/SDL_x11mouse.c
+++ b/src/video/x11/SDL_x11mouse.c
@@ -416,6 +416,9 @@ static Uint32 X11_GetGlobalMouseState(int *x, int *y)
 
 #if !SDL_VIDEO_DRIVER_X11_XINPUT2
     videodata->global_mouse_changed = SDL_TRUE;
+#else
+    if (!SDL_X11_HAVE_XINPUT2)
+        videodata->global_mouse_changed = SDL_TRUE;
 #endif
 
     /* check if we have this cached since XInput last saw the mouse move. */