diff options
-rw-r--r-- | gdk/wayland/gdkdisplay-wayland.c | 14 | ||||
-rw-r--r-- | gdk/wayland/gdkdisplay-wayland.h | 3 | ||||
-rw-r--r-- | gdk/wayland/gdkpopup-wayland.c | 11 | ||||
-rw-r--r-- | gdk/wayland/gdktoplevel-wayland.c | 9 |
4 files changed, 21 insertions, 16 deletions
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c index 99caeb20d5..67fa059e99 100644 --- a/gdk/wayland/gdkdisplay-wayland.c +++ b/gdk/wayland/gdkdisplay-wayland.c @@ -2694,3 +2694,17 @@ gdk_wayland_display_query_registry (GdkDisplay *display, return FALSE; } + +void +gdk_wayland_display_dispatch_queue (GdkDisplay *display, + struct wl_event_queue *event_queue) +{ + GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); + + 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); + } +} diff --git a/gdk/wayland/gdkdisplay-wayland.h b/gdk/wayland/gdkdisplay-wayland.h index 40f101f9ff..213680361b 100644 --- a/gdk/wayland/gdkdisplay-wayland.h +++ b/gdk/wayland/gdkdisplay-wayland.h @@ -158,6 +158,9 @@ struct _GdkWaylandDisplayClass gboolean gdk_wayland_display_prefers_ssd (GdkDisplay *display); +void gdk_wayland_display_dispatch_queue (GdkDisplay *display, + struct wl_event_queue *event_queue); + G_END_DECLS #endif /* __GDK_WAYLAND_DISPLAY__ */ diff --git a/gdk/wayland/gdkpopup-wayland.c b/gdk/wayland/gdkpopup-wayland.c index 125e70e638..a79670aef2 100644 --- a/gdk/wayland/gdkpopup-wayland.c +++ b/gdk/wayland/gdkpopup-wayland.c @@ -1334,8 +1334,6 @@ gdk_wayland_surface_present_popup (GdkWaylandPopup *wayland_popup, GdkPopupLayout *layout) { GdkSurface *surface = GDK_SURFACE (wayland_popup); - GdkWaylandDisplay *display_wayland = - GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface)); GdkWaylandSurface *wayland_surface = GDK_WAYLAND_SURFACE (wayland_popup); if (!wayland_surface->mapped) @@ -1389,13 +1387,8 @@ gdk_wayland_surface_present_popup (GdkWaylandPopup *wayland_popup, while (wayland_popup->display_server.xdg_popup && !is_relayout_finished (surface)) { - 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); - } + gdk_wayland_display_dispatch_queue (surface->display, + wayland_surface->event_queue); } if (wayland_popup->display_server.xdg_popup) diff --git a/gdk/wayland/gdktoplevel-wayland.c b/gdk/wayland/gdktoplevel-wayland.c index 7a74967c8d..c198477612 100644 --- a/gdk/wayland/gdktoplevel-wayland.c +++ b/gdk/wayland/gdktoplevel-wayland.c @@ -2120,13 +2120,8 @@ gdk_wayland_toplevel_focus (GdkToplevel *toplevel, while (startup_id == NULL) { - 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); - } + gdk_wayland_display_dispatch_queue (GDK_DISPLAY (display_wayland), + event_queue); } xdg_activation_token_v1_destroy (token); |