From 5fa8b24b2b4995cefdef0ae7314ad0d984275e61 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 19 Aug 2019 15:36:32 +0200 Subject: [PATCH] xwayland: pass the X11 display Pass the X11 display to `meta_xwayland_complete_init()` so that it can be used without poking into GDK. https://gitlab.gnome.org/GNOME/mutter/merge_requests/735 --- src/wayland/meta-xwayland-private.h | 3 ++- src/wayland/meta-xwayland.c | 3 ++- src/x11/meta-x11-display.c | 5 ++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wayland/meta-xwayland-private.h b/src/wayland/meta-xwayland-private.h index ef5a3db51..481cffd22 100644 --- a/src/wayland/meta-xwayland-private.h +++ b/src/wayland/meta-xwayland-private.h @@ -29,7 +29,8 @@ meta_xwayland_init (MetaXWaylandManager *manager, struct wl_display *display); void -meta_xwayland_complete_init (MetaDisplay *display); +meta_xwayland_complete_init (MetaDisplay *display, + Display *xdisplay); void meta_xwayland_shutdown (MetaXWaylandManager *manager); diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index a25e645bb..1ba3e00c2 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -790,7 +790,8 @@ on_x11_display_closing (MetaDisplay *display) /* To be called right after connecting */ void -meta_xwayland_complete_init (MetaDisplay *display) +meta_xwayland_complete_init (MetaDisplay *display, + Display *xdisplay) { MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default (); MetaXWaylandManager *manager = &compositor->xwayland_manager; diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c index 397c9610e..023c9cc1f 100644 --- a/src/x11/meta-x11-display.c +++ b/src/x11/meta-x11-display.c @@ -1119,14 +1119,13 @@ meta_x11_display_new (MetaDisplay *display, GError **error) g_assert (prepared_gdk_display); gdk_display = g_steal_pointer (&prepared_gdk_display); + xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display); #ifdef HAVE_WAYLAND if (meta_is_wayland_compositor ()) - meta_xwayland_complete_init (display); + meta_xwayland_complete_init (display, xdisplay); #endif - xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display); - if (meta_is_syncing ()) XSynchronize (xdisplay, True);