From c9992a29530a02292c634b441ca9f0a6702b39dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 25 Feb 2021 17:40:45 +0100 Subject: [PATCH] main: Initialize Wayland just before MetaDisplay Wayland support is not really a "backend" thing, it just lacked a better place to store its instance pointer. Eventually we'll have a better place, but prepare for that by initializing it together with the more similar subsystems. Part-of: --- src/backends/native/meta-backend-native.c | 4 ---- src/backends/x11/nested/meta-backend-x11-nested.c | 4 ---- src/core/main.c | 5 +++++ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c index 399560f1e..98d6c1a57 100644 --- a/src/backends/native/meta-backend-native.c +++ b/src/backends/native/meta-backend-native.c @@ -234,10 +234,6 @@ meta_backend_native_post_init (MetaBackend *backend) #endif update_viewports (backend); - -#ifdef HAVE_WAYLAND - meta_backend_init_wayland (backend); -#endif } static MetaMonitorManager * diff --git a/src/backends/x11/nested/meta-backend-x11-nested.c b/src/backends/x11/nested/meta-backend-x11-nested.c index dd9f31858..bf6296dbf 100644 --- a/src/backends/x11/nested/meta-backend-x11-nested.c +++ b/src/backends/x11/nested/meta-backend-x11-nested.c @@ -243,10 +243,6 @@ meta_backend_x11_nested_post_init (MetaBackend *backend) META_BACKEND_CLASS (meta_backend_x11_nested_parent_class); backend_class->post_init (backend); - -#ifdef HAVE_WAYLAND - meta_backend_init_wayland (backend); -#endif } static gboolean diff --git a/src/core/main.c b/src/core/main.c index dae1b4e53..76d3ef5df 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -852,6 +852,11 @@ meta_start (void) { meta_prefs_init (); +#ifdef HAVE_WAYLAND + if (meta_is_wayland_compositor ()) + meta_backend_init_wayland (meta_get_backend ()); +#endif + if (!meta_display_open ()) meta_exit (META_EXIT_ERROR); }