From ddbe15fd03a2fd6b6bbd7f5b618012fa5df700aa Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 28 Jan 2024 21:51:57 +0100 Subject: [PATCH] Fix gdk livelock on Windows when compiled with recent mingw/gcc recent gcc (>=11) sets _WIN32_WINNT >= 0x602 which changes QS_ALLINPUT to include (QS_TOUCH | QS_POINTER) events which are only available on Windows 8 and later. Listening to those events makes ardour unresponsive. --- libs/tk/ydk/win32/gdkevents-win32.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/tk/ydk/win32/gdkevents-win32.c b/libs/tk/ydk/win32/gdkevents-win32.c index b4b2a94dd7..e78ed38f02 100644 --- a/libs/tk/ydk/win32/gdkevents-win32.c +++ b/libs/tk/ydk/win32/gdkevents-win32.c @@ -86,6 +86,8 @@ #define SYNAPSIS_ICON_WINDOW_CLASS "SynTrackCursorWindowClass" +#define QS_YDK_RELEVANT_INPUT 0x4ff // = QS_KEY | QS_MOUSEMOVE | QS_MOUSEBUTTON | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY | QS_SENDMESSAGE | QS_RAWINPUT + static gboolean gdk_event_translate (MSG *msg, gint *ret_valp); static void handle_wm_paint (MSG *msg, @@ -382,7 +384,7 @@ gdk_events_pending (void) { return (_gdk_event_queue_find_first (_gdk_display) || (modal_win32_dialog == NULL && - GetQueueStatus (QS_ALLINPUT) != 0)); + GetQueueStatus (QS_YDK_RELEVANT_INPUT) != 0)); } GdkEvent* @@ -3653,7 +3655,7 @@ gdk_event_prepare (GSource *source, retval = (_gdk_event_queue_find_first (_gdk_display) != NULL || (modal_win32_dialog == NULL && - GetQueueStatus (QS_ALLINPUT) != 0)); + GetQueueStatus (QS_YDK_RELEVANT_INPUT) != 0)); GDK_THREADS_LEAVE (); @@ -3671,7 +3673,7 @@ gdk_event_check (GSource *source) { retval = (_gdk_event_queue_find_first (_gdk_display) != NULL || (modal_win32_dialog == NULL && - GetQueueStatus (QS_ALLINPUT) != 0)); + GetQueueStatus (QS_YDK_RELEVANT_INPUT) != 0)); } else {