]> Pileus Git - ~andy/gtk/commitdiff
wayland: React to G_IO_ERR and G_IO_HUP on the wayland socket
authorRob Bradford <rob@linux.intel.com>
Wed, 6 Feb 2013 18:08:15 +0000 (18:08 +0000)
committerRob Bradford <rob@linux.intel.com>
Wed, 6 Feb 2013 18:08:58 +0000 (18:08 +0000)
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=692728
gdk/wayland/gdkeventsource.c

index 31918f4a66a31ea1740e083c715db731e490f918..1eff3fbb94e3301b647043fdaefb730218a16448 100644 (file)
@@ -54,6 +54,9 @@ gdk_event_source_check(GSource *base)
 {
   GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
 
+  if (source->pfd.revents & (G_IO_ERR | G_IO_HUP))
+    g_error ("Lost connection to wayland compositor");
+
   return _gdk_event_queue_find_first (source->display) != NULL ||
     source->pfd.revents;
 }
@@ -124,7 +127,7 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
   display_wayland = GDK_WAYLAND_DISPLAY (display);
   wl_source->display = display;
   wl_source->pfd.fd = wl_display_get_fd(display_wayland->wl_display);
-  wl_source->pfd.events = G_IO_IN | G_IO_ERR;
+  wl_source->pfd.events = G_IO_IN | G_IO_ERR | G_IO_HUP;
   g_source_add_poll(source, &wl_source->pfd);
 
   g_source_set_priority (source, GDK_PRIORITY_EVENTS);