GNOME Bugzilla – Bug 703892
If the compositor goes away the client can spin forever
Last modified: 2013-07-09 23:01:49 UTC
This change is needed in combination with: http://lists.freedesktop.org/archives/wayland-devel/2013-July/010218.html to fix the problem.
Created attachment 248759 [details] [review] wayland: Handle the display connection erroring out wl_display_flush or wl_display_dispatch can return -1 if there is an error on the display connection.
Patchs looks good, committed. It's a valid fix and solves the problem, but the regression was this: commit 99b78fdd7f21539a288bfe846542b633756ce163 Author: Kristian Høgsberg <krh@bitplanet.net> Date: Tue Jul 9 18:35:06 2013 -0400 wayland: Don't clear revents until we've checked for G_IO_HUP https://bugzilla.gnome.org/show_bug.cgi?id=703892 diff --git a/gdk/wayland/gdkeventsource.c b/gdk/wayland/gdkeventsource.c index cb335bd..4bcae9b 100644 --- a/gdk/wayland/gdkeventsource.c +++ b/gdk/wayland/gdkeventsource.c @@ -150,12 +150,12 @@ _gdk_wayland_display_queue_events (GdkDisplay *display) display_wayland = GDK_WAYLAND_DISPLAY (display); source = (GdkWaylandEventSource *) display_wayland->event_source; + if (source->pfd.revents & G_IO_IN) - { - wl_display_dispatch(display_wayland->wl_display); - source->pfd.revents = 0; - } + wl_display_dispatch (display_wayland->wl_display); if (source->pfd.revents & (G_IO_ERR | G_IO_HUP)) g_error ("Lost connection to wayland compositor"); + + source->pfd.revents = 0; } which I also committed.