SDL: autotools, cmake: test Xfixes along with XInput2.h:

From fa3330baecd3a90c7dc8f8539a7f048e6cf8d316 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Fri, 12 Nov 2021 12:55:50 +0300
Subject: [PATCH] autotools, cmake: test Xfixes along with XInput2.h:

because we use Xfixes with XIBarrierReleasePointer
---
 cmake/sdlchecks.cmake | 5 +++--
 configure             | 4 +++-
 configure.ac          | 4 +++-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index 23b8793d27..dbf4490da3 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -525,14 +525,15 @@ macro(CheckX11)
         endif()
       endif()
 
-      if(SDL_X11_XFIXES AND HAVE_XFIXES_H)
+      # check along with XInput2.h because we use Xfixes with XIBarrierReleasePointer
+      if(SDL_X11_XFIXES AND HAVE_XFIXES_H AND HAVE_XINPUT2_H)
         if(HAVE_X11_SHARED AND XFIXES_LIB)
           set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES "\"${XFIXES_LIB_SONAME}\"")
         else()
           list(APPEND EXTRA_LIBS ${XFIXES_LIB})
         endif()
         set(SDL_VIDEO_DRIVER_X11_XFIXES 1)
-        set(HAVE_VIDEO_X11_XFIXES TRUE)
+        set(HAVE_X11_XFIXES TRUE)
       endif()
 
       if(SDL_X11_XRANDR AND HAVE_XRANDR_H)
diff --git a/configure b/configure
index 023f26bd2c..65178a0bb3 100755
--- a/configure
+++ b/configure
@@ -21502,8 +21502,10 @@ fi
 
             if test x$enable_video_x11_xfixes = xyes; then
                 definitely_enable_video_x11_xfixes=no
+                # check along with XInput2.h because we use Xfixes with XIBarrierReleasePointer
                 ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xfixes.h" "ac_cv_header_X11_extensions_Xfixes_h" "#include <X11/Xlib.h>
-
+                                 #include <X11/Xproto.h>
+                                 #include <X11/extensions/XInput2.h>
 "
 if test "x$ac_cv_header_X11_extensions_Xfixes_h" = xyes; then :
   have_xfixes_h_hdr=yes
diff --git a/configure.ac b/configure.ac
index 322f166f96..519b2d1737 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1974,11 +1974,13 @@ XITouchClassInfo *t;
                             , enable_video_x11_xfixes=yes)
             if test x$enable_video_x11_xfixes = xyes; then
                 definitely_enable_video_x11_xfixes=no
+                # check along with XInput2.h because we use Xfixes with XIBarrierReleasePointer
                 AC_CHECK_HEADER(X11/extensions/Xfixes.h,
                                 have_xfixes_h_hdr=yes,
                                 have_xfixes_h_hdr=no,
                                 [#include <X11/Xlib.h>
-                                ])
+                                 #include <X11/Xproto.h>
+                                 #include <X11/extensions/XInput2.h>])
                 if test x$have_xfixes_h_hdr = xyes; then
                     if test x$enable_x11_shared = xyes && test x$xfixes_lib != x ; then
                         echo "-- dynamic libXfixes -> $xfixes_lib"