Browse Source

x11: More XInput2 #define cleanups

Fixes building on very old XInput2 versions (pre-2012) without smooth scrolling and multitouch.

(cherry picked from commit 62af66f14a57bfb73c387f7c618aac0fad2bb695)
Frank Praznik 23 hours ago
parent
commit
a4c326a7bb
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/video/x11/SDL_x11xinput2.c

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

@@ -34,11 +34,11 @@
 
 
 #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2
 #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2
 static bool xinput2_initialized;
 static bool xinput2_initialized;
+static bool xinput2_grabbed_touch_raised;
+static int xinput2_active_touch_count;
 #if defined(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_SCROLLINFO) || defined(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH)
 #if defined(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_SCROLLINFO) || defined(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH)
 static bool xinput2_scrolling_supported;
 static bool xinput2_scrolling_supported;
 static bool xinput2_multitouch_supported;
 static bool xinput2_multitouch_supported;
-static bool xinput2_grabbed_touch_raised;
-static int xinput2_active_touch_count;
 #endif
 #endif
 #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_GESTURE
 #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_GESTURE
 static bool xinput2_gesture_supported;
 static bool xinput2_gesture_supported;
@@ -951,6 +951,7 @@ static bool HasDeviceID(Uint32 deviceID, const Uint32 *list, int count)
     return false;
     return false;
 }
 }
 
 
+#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
 static void AddDeviceID64(Uint64 deviceID, Uint64 **list, int *count)
 static void AddDeviceID64(Uint64 deviceID, Uint64 **list, int *count)
 {
 {
     int new_count = (*count + 1);
     int new_count = (*count + 1);
@@ -964,6 +965,7 @@ static void AddDeviceID64(Uint64 deviceID, Uint64 **list, int *count)
     *count = new_count;
     *count = new_count;
     *list = new_list;
     *list = new_list;
 }
 }
+#endif
 
 
 static bool HasDeviceID64(Uint64 deviceID, const Uint64 *list, int count)
 static bool HasDeviceID64(Uint64 deviceID, const Uint64 *list, int count)
 {
 {