mirror of
https://github.com/brl/mutter.git
synced 2025-07-24 10:28:02 +00:00
compositor: Get the stage via the backend
We would get the MetaDisplay from the backend singleton before creating the MetaCompositor, then in MetaCompositor, get the backend singleton again to get the stage. To get rid of the extra singleton fetching, just pass the backend the MetaCompositor constructors, and fetch the stage directly from the backend everytime it's needed. This also makes it available earlier than before, as we didn't set our instance private stage pointer until the manage() call. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1289
This commit is contained in:

committed by
Georges Basile Stavracas Neto

parent
9fc428f2e7
commit
25f9406e69
@@ -573,17 +573,17 @@ meta_display_remove_pending_pings_for_window (MetaDisplay *display,
|
||||
static MetaCompositor *
|
||||
create_compositor (MetaDisplay *display)
|
||||
{
|
||||
#ifdef HAVE_WAYLAND
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
if (META_IS_BACKEND_NATIVE (backend))
|
||||
return META_COMPOSITOR (meta_compositor_native_new (display));
|
||||
return META_COMPOSITOR (meta_compositor_native_new (display, backend));
|
||||
#endif
|
||||
if (META_IS_BACKEND_X11_NESTED (backend))
|
||||
return META_COMPOSITOR (meta_compositor_server_new (display));
|
||||
return META_COMPOSITOR (meta_compositor_server_new (display, backend));
|
||||
#endif
|
||||
return META_COMPOSITOR (meta_compositor_x11_new (display));
|
||||
return META_COMPOSITOR (meta_compositor_x11_new (display, backend));
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user