[mutter] wayland/compositor: Pass backend when constructing
- From: Robert Mader <rmader src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland/compositor: Pass backend when constructing
- Date: Tue, 26 May 2020 15:42:01 +0000 (UTC)
commit e8b09df8d2746eacd341b00160b02738e9e5e8a1
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Mon Apr 27 13:37:16 2020 +0200
wayland/compositor: Pass backend when constructing
This is so that it can be retrieved later without going via the global
singleton.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1218
src/backends/meta-backend.c | 2 +-
src/wayland/meta-wayland-private.h | 2 ++
src/wayland/meta-wayland.c | 9 +++++++--
src/wayland/meta-wayland.h | 2 +-
4 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index d6892f5bb6..f57a785801 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -886,7 +886,7 @@ meta_backend_init_wayland_display (MetaBackend *backend)
{
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
- priv->wayland_compositor = meta_wayland_compositor_new ();
+ priv->wayland_compositor = meta_wayland_compositor_new (backend);
}
void
diff --git a/src/wayland/meta-wayland-private.h b/src/wayland/meta-wayland-private.h
index e28ca06d66..a7e5604fcb 100644
--- a/src/wayland/meta-wayland-private.h
+++ b/src/wayland/meta-wayland-private.h
@@ -74,6 +74,8 @@ struct _MetaWaylandCompositor
{
GObject parent;
+ MetaBackend *backend;
+
struct wl_display *wayland_display;
char *display_name;
GHashTable *outputs;
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index a7bf9158ce..b37d9fdcf1 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -362,9 +362,14 @@ meta_wayland_get_xwayland_auth_file (MetaWaylandCompositor *compositor)
}
MetaWaylandCompositor *
-meta_wayland_compositor_new (void)
+meta_wayland_compositor_new (MetaBackend *backend)
{
- return g_object_new (META_TYPE_WAYLAND_COMPOSITOR, NULL);
+ MetaWaylandCompositor *compositor;
+
+ compositor = g_object_new (META_TYPE_WAYLAND_COMPOSITOR, NULL);
+ compositor->backend = backend;
+
+ return compositor;
}
void
diff --git a/src/wayland/meta-wayland.h b/src/wayland/meta-wayland.h
index 15b7310ba7..4164563e83 100644
--- a/src/wayland/meta-wayland.h
+++ b/src/wayland/meta-wayland.h
@@ -37,7 +37,7 @@ void meta_wayland_init (void);
void meta_wayland_finalize (void);
-MetaWaylandCompositor * meta_wayland_compositor_new (void);
+MetaWaylandCompositor * meta_wayland_compositor_new (MetaBackend *backend);
void meta_wayland_compositor_setup (MetaWaylandCompositor *compositor);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]