From 37b0910d806ce212831cfc0fc4064f385f7e88ff Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 2 Nov 2024 03:41:50 +0100 Subject: [PATCH] Windows Multitouch: disable gestures Gestures may prevent a 2nd touch from being registered as such (and instead report a zoom/pinch gesture). At least that is my best guess, why Nathan needs 3 fingers to move 2 Faders :) --- libs/tk/ydk/win32/gdkwindow-win32.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libs/tk/ydk/win32/gdkwindow-win32.c b/libs/tk/ydk/win32/gdkwindow-win32.c index d91868638b..3b920915d1 100644 --- a/libs/tk/ydk/win32/gdkwindow-win32.c +++ b/libs/tk/ydk/win32/gdkwindow-win32.c @@ -30,6 +30,8 @@ #include "config.h" #include +#include + #include "gdk.h" #include "gdkwindowimpl.h" #include "gdkprivate-win32.h" @@ -52,6 +54,17 @@ static GSList *modal_window_stack = NULL; typedef struct _FullscreenInfo FullscreenInfo; +#ifndef GC_ALLGESTURES +typedef struct tagGESTURECONFIG { + DWORD dwID; + DWORD dwWant; + DWORD dwBlock; +} GESTURECONFIG,*PGESTURECONFIG; +#endif + +typedef BOOL (WINAPI *PFN_SetGestureConfig) (HWND, DWORD, UINT, PGESTURECONFIG, UINT); +static PFN_SetGestureConfig setGestureConfig = 0; + struct _FullscreenInfo { RECT r; @@ -168,6 +181,8 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass) drawable_class->set_colormap = gdk_window_impl_win32_set_colormap; drawable_class->get_colormap = gdk_window_impl_win32_get_colormap; drawable_class->get_size = gdk_window_impl_win32_get_size; + + setGestureConfig = (PFN_SetGestureConfig) GetProcAddress (GetModuleHandle ("user32.dll"), "SetGestureConfig"); } static void @@ -315,6 +330,12 @@ _gdk_windowing_window_init (GdkScreen *screen) gdk_win32_handle_table_insert ((HANDLE *) &draw_impl->handle, _gdk_root); + if (setGestureConfig) + { + GESTURECONFIG gc[1] = {{0, 0, 1 /*GC_ALLGESTURES*/}}; + setGestureConfig (GDK_WINDOW_HWND (_gdk_root), 0, 1, gc, sizeof (gc)); + } + GDK_NOTE (MISC, g_print ("_gdk_root=%p\n", GDK_WINDOW_HWND (_gdk_root))); }