GNOME Bugzilla – Bug 708998
Infinite loop in gdkevents.c _gdk_event_queue_find_first on OS X
Last modified: 2014-01-25 02:14:11 UTC
I was having trouble with keyboard accelerators on OS X. I am using Gtk 3.8, but I think the bug is still in Gtk 3.10 and in git. When there is an event with the GDK_EVENT_PENDING flag set, the function goes into an infinite loop. It looks like an oversight in this change... https://git.gnome.org/browse/gtk+/commit/gdk/gdkevents.c?id=a69285da08a2a61d5fd817ee8ccb88a6b6deaef6 I think the fix might be to change if (event->flags & GDK_EVENT_PENDING) continue; ... tmp_list = g_list_next (tmp_list); to if (!(event->flags & GDK_EVENT_PENDING)) { ... } tmp_list = g_list_next (tmp_list); It seems to work.
Created attachment 255988 [details] [review] Avoids infinite loop
Comment on attachment 255988 [details] [review] Avoids infinite loop I think using for instead of while and leaving the loop body as-is (except for the g_list_next, of course) would be cleaner. The bug was introduced in a69285da.
Created attachment 256023 [details] [review] Updated patch
Comment on attachment 256023 [details] [review] Updated patch Are you allergic to for loops on lists?
Created attachment 256033 [details] [review] Updated patch Sorry did not read your comment carefully enough, completely missed the point.
Created attachment 256034 [details] [review] Fix formatting as well
Comment on attachment 256034 [details] [review] Fix formatting as well OK, that looks good. We just need Matthias to OK it.
Comment on attachment 256034 [details] [review] Fix formatting as well Waited long enough. Committed and backported to 3.10.