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; g_autoptr (GError) error = NULL;
if (!meta_xwayland_init (&compositor->xwayland_manager, if (!meta_xwayland_init (&compositor->xwayland_manager,
compositor,
compositor->wayland_display, compositor->wayland_display,
&error)) &error))
g_error ("Failed to start X Wayland: %s", error->message); g_error ("Failed to start X Wayland: %s", error->message);

View File

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

View File

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