After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703892 - If the compositor goes away the client can spin forever
If the compositor goes away the client can spin forever
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-07-09 17:58 UTC by Rob Bradford
Modified: 2013-07-09 23:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Handle the display connection erroring out (1.64 KB, patch)
2013-07-09 17:58 UTC, Rob Bradford
none Details | Review

Description Rob Bradford 2013-07-09 17:58:46 UTC
This change is needed in combination with:
http://lists.freedesktop.org/archives/wayland-devel/2013-July/010218.html to
fix the problem.
Comment 1 Rob Bradford 2013-07-09 17:58:48 UTC
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.
Comment 2 Kristian Høgsberg 2013-07-09 23:01:49 UTC
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.