[mutter] xwayland: Pass MetaWaylandCompositor pointer when initializing



commit dc97163bcd6246cbe6c12b9c7257cef571553f02
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Thu May 6 18:49:25 2021 +0200

    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>

 src/wayland/meta-wayland.c          | 1 +
 src/wayland/meta-xwayland-private.h | 7 ++++---
 src/wayland/meta-xwayland.c         | 8 +++++---
 3 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index 842136ef40..4145e65c8f 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -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);
diff --git a/src/wayland/meta-xwayland-private.h b/src/wayland/meta-xwayland-private.h
index 2e38f380db..51fba035eb 100644
--- a/src/wayland/meta-xwayland-private.h
+++ b/src/wayland/meta-xwayland-private.h
@@ -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,
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index 9926f63d44..345ade297e 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]