From f6383ebf9ed3f8557b2eb9088887f2c9ac5fd0c7 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 6 Feb 2013 18:08:15 +0000 Subject: [PATCH] wayland: React to G_IO_ERR and G_IO_HUP on the wayland socket Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=692728 --- gdk/wayland/gdkeventsource.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdk/wayland/gdkeventsource.c b/gdk/wayland/gdkeventsource.c index 31918f4a6..1eff3fbb9 100644 --- a/gdk/wayland/gdkeventsource.c +++ b/gdk/wayland/gdkeventsource.c @@ -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); -- 2.43.2