GNOME Bugzilla – Bug 694274
wayland: don't attempt to unqueue events when events are paused
Last modified: 2014-02-14 00:56:05 UTC
gdk_display_get_event will return NULL when events are paused and therefore no events can be processed.
Created attachment 236938 [details] [review] wayland: don't attempt to unqueue events when events are paused
Review of attachment 236938 [details] [review]: LGTM, can we have a bit more explanation in the commit message ?
Created attachment 236961 [details] [review] Broadway/Quartz/Win32: make event source prepare()/check() note paused status Here's a patch for the rest of the backends, feel free to squash it in and steal the text from the commit message for a detailed explanation.
(In reply to comment #1) > Created an attachment (id=236938) [details] [review] > wayland: don't attempt to unqueue events when events are paused Fixes the lock-ups I was seeing. Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Review of attachment 236961 [details] [review]: looks fine to me
I didn't squash the two patches - but I duplicated the explanatory text from my commit to the Wayland commit. Attachment 236938 [details] pushed as 00a107c - wayland: don't attempt to unqueue events when events are paused Attachment 236961 [details] pushed as df3e19b - Broadway/Quartz/Win32: make event source prepare()/check() note paused status
df3e19b breaks the build in quartz: gdkeventloop-quartz.c: In function 'gdk_event_prepare': gdkeventloop-quartz.c:623: error: 'display' undeclared (first use in this function) gdkeventloop-quartz.c:623: error: (Each undeclared identifier is reported only once gdkeventloop-quartz.c:623: error: for each function it appears in.) gdkeventloop-quartz.c: In function 'gdk_event_check': gdkeventloop-quartz.c:641: error: 'display' undeclared (first use in this function)
A patch and testing would be much appreciated! :-) I can keep on making changes to the code, but...
The fix is obvious from the surrounding code: _gdk_display instead of display, and #include <gdk/gdkdisplayprivate.h> is required. I've fixed it for you, afe8ce2.
The (In reply to comment #10) > The fix is obvious from the surrounding code: _gdk_display instead of display, > and #include <gdk/gdkdisplayprivate.h> is required. > > I've fixed it for you, afe8ce2. The same also happened to the Win32 backend-I proposed a patch, which seems to be similar in approach to John's patch to bug 694339. Can I ask someone to give a quick look at that (and the other patches there) too? With blessings, thank you!
I think there is still a bug here. Returning FALSE from check/prepare() will prevent events from being dispatched, but since the pollfd is still registered with the mainloop, we're going to spin (since poll() will return immediately due to available IO).