Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable tablet flicks under MS Windows. #5176

Merged
merged 1 commit into from Jan 22, 2022

Conversation

ulatekh
Copy link
Contributor

@ulatekh ulatekh commented Jan 4, 2022

Existing discussion at https://discourse.libsdl.org/t/disable-tablet-flicks-on-ms-windows-by-default/34156 .
In short, enabling tablet-flicks messes up touch recognition under MS Windows.

Had to bump the internally-set MS Windows version from XP to Vista.
Hopefully it's safe to say no one is running XP any more.

@slouken slouken added this to the 2.0.22 milestone Jan 4, 2022
@sezero
Copy link
Contributor

sezero commented Jan 6, 2022

@slouken: Is the following OK to apply, so that @ulatekh can use HAVE_TPCSHRD_H checks?

diff --git a/CMakeLists.txt b/CMakeLists.txt
index afbddce..9a61ba2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1581,6 +1581,7 @@ elseif(WINDOWS)
   endif()
 
   # headers needed elsewhere
+  check_include_file(tpcshrd.h HAVE_TPCSHRD_H)
   check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
   check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
   check_include_file(sensorsapi.h HAVE_SENSORSAPI_H)
diff --git a/configure.ac b/configure.ac
index 56377d5..fec064d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3971,6 +3971,10 @@ case "$host" in
                 have_haptic=yes
             fi
         fi
+        AC_CHECK_HEADER(tpcshrd.h,have_tpcshrd_h=yes)
+        if test x$have_tpcshrd_h = xyes; then
+            AC_DEFINE(HAVE_TPCSHRD_H, 1, [ ])
+        fi
         # Set up files for the sensor library
         AC_CHECK_HEADER(sensorsapi.h,have_winsensors=yes,have_winsensors=no)
         if test x$have_winsensors = xyes; then
diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake
index 483de8a..7f96bbe 100644
--- a/include/SDL_config.h.cmake
+++ b/include/SDL_config.h.cmake
@@ -251,6 +251,7 @@
 
 #cmakedefine HAVE_MMDEVICEAPI_H @HAVE_MMDEVICEAPI_H@
 #cmakedefine HAVE_AUDIOCLIENT_H @HAVE_AUDIOCLIENT_H@
+#cmakedefine HAVE_TPCSHRD_H @HAVE_TPCSHRD_H@
 #cmakedefine HAVE_SENSORSAPI_H @HAVE_SENSORSAPI_H@
 
 #cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@
diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in
index 487512c..0d981b4 100644
--- a/include/SDL_config.h.in
+++ b/include/SDL_config.h.in
@@ -240,6 +240,7 @@
 
 #undef HAVE_MMDEVICEAPI_H
 #undef HAVE_AUDIOCLIENT_H
+#undef HAVE_TPCSHRD_H
 #undef HAVE_SENSORSAPI_H
 
 /* SDL internal assertion support */
diff --git a/include/SDL_config_windows.h b/include/SDL_config_windows.h
index fbf823d..c9ed1cf 100644
--- a/include/SDL_config_windows.h
+++ b/include/SDL_config_windows.h
@@ -103,6 +103,7 @@ typedef unsigned int uintptr_t;
 #endif
 #define HAVE_MMDEVICEAPI_H 1
 #define HAVE_AUDIOCLIENT_H 1
+#define HAVE_TPCSHRD_H 1
 #define HAVE_SENSORSAPI_H 1
 #if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
 #define HAVE_IMMINTRIN_H 1
diff --git a/include/SDL_config_winrt.h b/include/SDL_config_winrt.h
index 3c1aec1..690ffe1 100644
--- a/include/SDL_config_winrt.h
+++ b/include/SDL_config_winrt.h
@@ -100,6 +100,7 @@ typedef unsigned int uintptr_t;
 
 #define HAVE_MMDEVICEAPI_H 1
 #define HAVE_AUDIOCLIENT_H 1
+#define HAVE_TPCSHRD_H 1
 
 #define HAVE_LIBC 1
 #define STDC_HEADERS 1
diff --git a/configure b/configure
index e9c5e24..d7c9316 100755
--- a/configure
+++ b/configure
@@ -26134,6 +26134,17 @@ $as_echo "#define SDL_HAPTIC_DINPUT 1" >>confdefs.h
                 have_haptic=yes
             fi
         fi
+        ac_fn_c_check_header_mongrel "$LINENO" "tpcshrd.h" "ac_cv_header_tpcshrd_h" "$ac_includes_default"
+if test "x$ac_cv_header_tpcshrd_h" = xyes; then :
+  have_tpcshrd_h=yes
+fi
+
+
+        if test x$have_tpcshrd_h = xyes; then
+
+$as_echo "#define HAVE_TPCSHRD_H 1" >>confdefs.h
+
+        fi
         # Set up files for the sensor library
         ac_fn_c_check_header_mongrel "$LINENO" "sensorsapi.h" "ac_cv_header_sensorsapi_h" "$ac_includes_default"
 if test "x$ac_cv_header_sensorsapi_h" = xyes; then :

ulatekh added a commit to ulatekh/SDL that referenced this pull request Jan 6, 2022
@sezero
Copy link
Contributor

sezero commented Jan 6, 2022

It would be better if the commits are squashed into a single commit

@sezero
Copy link
Contributor

sezero commented Jan 6, 2022

@slouken: Is the following OK to apply, so that @ulatekh can use HAVE_TPCSHRD_H checks?

OK, now that the op changed his preprocessor checks, I took the liberty of applying the configury/cmake patch to master.

@ulatekh
Copy link
Contributor Author

ulatekh commented Jan 6, 2022

Thanks for committing the HAVE_TPCSHRD_H change; I've squashed the commits together, and rebased on top of the latest main branch.

@sezero
Copy link
Contributor

sezero commented Jan 7, 2022

@slouken: This should be ready for a re-review.

@slouken
Copy link
Collaborator

slouken commented Jan 7, 2022

Yep, I'll take a look once 2.0.20 is released. This change needs more beta time than the 2.0.20 timeline.

@ulatekh
Copy link
Contributor Author

ulatekh commented Jan 22, 2022

2.0.20 has been released, correct? Can this change be merged?

@slouken
Copy link
Collaborator

slouken commented Jan 22, 2022

Yup! :)

@slouken slouken merged commit d7873e6 into libsdl-org:main Jan 22, 2022
@ulatekh ulatekh deleted the disable-tablet-flicks branch January 23, 2022 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants