diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2013-03-30 14:17:07 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-03-30 14:20:00 -0400 |
commit | 8886c63a4e7f7f934f727e6d965237000eb7631e (patch) | |
tree | e26a3aa6de3bebf6fd143eadc086d6ac6d8c703d /gdk/wayland | |
parent | 50097d5baa790b46ea873c74294112194a9d622b (diff) | |
download | gtk+-8886c63a4e7f7f934f727e6d965237000eb7631e.tar.gz |
wayland: Don't error out on G_IO_HUP until we've read G_IO_IN data
We can get G_IO_HUP and G_IO_IN at the same time, if the compositor writes
data to us and then closes our connection. Make sure that we dispatch events
always if we have G_IO_IN and then error out if we get G_IO_HUP after that.
Diffstat (limited to 'gdk/wayland')
-rw-r--r-- | gdk/wayland/gdkeventsource.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdk/wayland/gdkeventsource.c b/gdk/wayland/gdkeventsource.c index 93f68dc3b6..cb335bd2c1 100644 --- a/gdk/wayland/gdkeventsource.c +++ b/gdk/wayland/gdkeventsource.c @@ -57,9 +57,6 @@ 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"); - if (source->display->event_pause_count > 0) return FALSE; @@ -153,9 +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) + if (source->pfd.revents & G_IO_IN) { wl_display_dispatch(display_wayland->wl_display); source->pfd.revents = 0; } + + if (source->pfd.revents & (G_IO_ERR | G_IO_HUP)) + g_error ("Lost connection to wayland compositor"); } |