From d82c6516ae400a7de9d9637dd132bb4e66412a9f Mon Sep 17 00:00:00 2001 From: Daemonratte Date: Sun, 18 Oct 2026 10:18:41 +0200 Subject: [PATCH] win32: only wait for the input types GDK handles Programs built with newer headers spun on Windows 8 or missed events on XP and 7. Taken from Ardour's YTK: - ddbe15fd (Robin Gareus) --- gdk/win32/gdkevents-win32.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index b875dd001..dec2fa729 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -87,6 +87,13 @@ #define SYNAPSIS_ICON_WINDOW_CLASS "SynTrackCursorWindowClass" +/* The input GDK waits for. Headers for Windows 8 and later add touch + * and pointer messages to QS_ALLINPUT: with those GDK keeps waking up + * for messages it does not take from the queue, and Windows 7 and + * earlier refuse the unknown flags and report nothing at all. */ +#define GDK_QS_INPUT (QS_KEY | QS_MOUSEMOVE | QS_MOUSEBUTTON | QS_POSTMESSAGE | \ + QS_TIMER | QS_PAINT | QS_HOTKEY | QS_SENDMESSAGE | 0x0400 /* QS_RAWINPUT */) + static gboolean gdk_event_translate (MSG *msg, gint *ret_valp); static void handle_wm_paint (MSG *msg, @@ -385,7 +392,7 @@ gdk_events_pending (void) { return (_gdk_event_queue_find_first (_gdk_display) || (modal_win32_dialog == NULL && - GetQueueStatus (QS_ALLINPUT) != 0)); + GetQueueStatus (GDK_QS_INPUT) != 0)); } GdkEvent* @@ -3667,7 +3674,7 @@ gdk_event_prepare (GSource *source, retval = (_gdk_event_queue_find_first (_gdk_display) != NULL || (modal_win32_dialog == NULL && - GetQueueStatus (QS_ALLINPUT) != 0)); + GetQueueStatus (GDK_QS_INPUT) != 0)); GDK_THREADS_LEAVE (); @@ -3685,7 +3692,7 @@ gdk_event_check (GSource *source) { retval = (_gdk_event_queue_find_first (_gdk_display) != NULL || (modal_win32_dialog == NULL && - GetQueueStatus (QS_ALLINPUT) != 0)); + GetQueueStatus (GDK_QS_INPUT) != 0)); } else {