diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2023-02-11 11:42:21 +0100 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2023-02-11 11:42:21 +0100 |
commit | a7fb9a6865dc73b77d059af2e64e718c750fb472 (patch) | |
tree | a6d6ffde4b2c3b1c56c9456648a400270b66ada7 /gdk | |
parent | 2365d9be1843d753857ae2aaed2b9e41c5e87523 (diff) | |
download | gtk+-a7fb9a6865dc73b77d059af2e64e718c750fb472.tar.gz |
wayland: Handle dispatch failing in a couple of more places
Without doing this, we'll end up with risking GTK processes sitting
eating 100% CPU instead of just exit(1):ing.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/wayland/gdkpopup-wayland.c | 10 | ||||
-rw-r--r-- | gdk/wayland/gdktoplevel-wayland.c | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/gdk/wayland/gdkpopup-wayland.c b/gdk/wayland/gdkpopup-wayland.c index 652cac8ef7..125e70e638 100644 --- a/gdk/wayland/gdkpopup-wayland.c +++ b/gdk/wayland/gdkpopup-wayland.c @@ -1388,7 +1388,15 @@ gdk_wayland_surface_present_popup (GdkWaylandPopup *wayland_popup, } while (wayland_popup->display_server.xdg_popup && !is_relayout_finished (surface)) - wl_display_dispatch_queue (display_wayland->wl_display, wayland_surface->event_queue); + { + if (wl_display_dispatch_queue (display_wayland->wl_display, + wayland_surface->event_queue) == -1) + { + g_message ("Error %d (%s) dispatching to Wayland display.", + errno, g_strerror (errno)); + _exit (1); + } + } if (wayland_popup->display_server.xdg_popup) { diff --git a/gdk/wayland/gdktoplevel-wayland.c b/gdk/wayland/gdktoplevel-wayland.c index bdaca587f9..7a74967c8d 100644 --- a/gdk/wayland/gdktoplevel-wayland.c +++ b/gdk/wayland/gdktoplevel-wayland.c @@ -2119,7 +2119,15 @@ gdk_wayland_toplevel_focus (GdkToplevel *toplevel, xdg_activation_token_v1_commit (token); while (startup_id == NULL) - wl_display_dispatch_queue (display_wayland->wl_display, event_queue); + { + if (wl_display_dispatch_queue (display_wayland->wl_display, + event_queue) == -1) + { + g_message ("Error %d (%s) dispatching to Wayland display.", + errno, g_strerror (errno)); + _exit (1); + } + } xdg_activation_token_v1_destroy (token); wl_event_queue_destroy (event_queue); |