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
This commit is contained in:
Jonas Ådahl 2020-04-27 13:37:16 +02:00
parent 1571f8078a
commit e8b09df8d2
4 changed files with 11 additions and 4 deletions

View File

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

View File

@ -74,6 +74,8 @@ struct _MetaWaylandCompositor
{
GObject parent;
MetaBackend *backend;
struct wl_display *wayland_display;
char *display_name;
GHashTable *outputs;

View File

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

View File

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