xwayland: Pass MetaWaylandCompositor pointer when initializing

This way we can initialize without having any way to retrieve it via
some global variable. This isn't needed now, but will be once Wayland
infrastructure initializiation is done in a single step.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1863>
This commit is contained in:
Jonas Ådahl 2021-05-06 18:49:25 +02:00 committed by Marge Bot
parent d03c194552
commit dc97163bcd
3 changed files with 10 additions and 6 deletions

View File

@ -558,6 +558,7 @@ meta_wayland_compositor_setup (MetaWaylandCompositor *compositor)
g_autoptr (GError) error = NULL;
if (!meta_xwayland_init (&compositor->xwayland_manager,
compositor,
compositor->wayland_display,
&error))
g_error ("Failed to start X Wayland: %s", error->message);

View File

@ -25,9 +25,10 @@
#include "wayland/meta-wayland-private.h"
gboolean
meta_xwayland_init (MetaXWaylandManager *manager,
struct wl_display *display,
GError **error);
meta_xwayland_init (MetaXWaylandManager *manager,
MetaWaylandCompositor *compositor,
struct wl_display *display,
GError **error);
void
meta_xwayland_complete_init (MetaDisplay *display,

View File

@ -568,6 +568,7 @@ xserver_died (GObject *source,
meta_display_shutdown_x11 (display);
if (!meta_xwayland_init (&compositor->xwayland_manager,
compositor,
compositor->wayland_display,
&error))
g_warning ("Failed to init X sockets: %s", error->message);
@ -1137,9 +1138,10 @@ meta_xwayland_stop_xserver (MetaXWaylandManager *manager)
}
gboolean
meta_xwayland_init (MetaXWaylandManager *manager,
struct wl_display *wl_display,
GError **error)
meta_xwayland_init (MetaXWaylandManager *manager,
MetaWaylandCompositor *compositor,
struct wl_display *wl_display,
GError **error)
{
MetaX11DisplayPolicy policy;
int display = 0;