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
This commit is contained in:
Olivier Fourdan 2019-08-19 15:36:32 +02:00
parent 9d65eab549
commit 5fa8b24b2b
3 changed files with 6 additions and 5 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);