From 6ecdf03efb83538acaffe7977b786b96eed50d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 19 Jan 2021 11:06:40 +0100 Subject: [PATCH] backend/native/clutter: Get seat ID from backend We don't need to have MetaLauncher set it and guess it if that fails, when we now have a getter from MetaBackendNative. Part-of: --- .../native/meta-clutter-backend-native.c | 24 +++++-------------- .../native/meta-clutter-backend-native.h | 2 -- src/backends/native/meta-launcher.c | 2 -- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/backends/native/meta-clutter-backend-native.c b/src/backends/native/meta-clutter-backend-native.c index 998f50e61..798f670c1 100644 --- a/src/backends/native/meta-clutter-backend-native.c +++ b/src/backends/native/meta-clutter-backend-native.c @@ -44,6 +44,7 @@ #include "backends/meta-backend-private.h" #include "backends/meta-renderer.h" +#include "backends/native/meta-backend-native.h" #include "backends/native/meta-seat-native.h" #include "backends/native/meta-stage-native.h" #include "clutter/clutter.h" @@ -58,8 +59,6 @@ struct _MetaClutterBackendNative MetaStageNative *stage_native; }; -static gchar *evdev_seat_id; - G_DEFINE_TYPE (MetaClutterBackendNative, meta_clutter_backend_native, CLUTTER_TYPE_BACKEND) @@ -104,7 +103,11 @@ meta_clutter_backend_native_init_events (ClutterBackend *clutter_backend) { MetaClutterBackendNative *clutter_backend_native = META_CLUTTER_BACKEND_NATIVE (clutter_backend); - const gchar *seat_id = evdev_seat_id ? evdev_seat_id : "seat0"; + MetaBackend *backend = meta_get_backend (); + MetaBackendNative *backend_native = META_BACKEND_NATIVE (backend); + const char *seat_id; + + seat_id = meta_backend_native_get_seat_id (backend_native); clutter_backend_native->main_seat = g_object_new (META_TYPE_SEAT_NATIVE, "backend", clutter_backend, @@ -158,18 +161,3 @@ meta_clutter_backend_native_class_init (MetaClutterBackendNativeClass *klass) clutter_backend_class->get_default_seat = meta_clutter_backend_native_get_default_seat; clutter_backend_class->is_display_server = meta_clutter_backend_native_is_display_server; } - -/** - * meta_cluter_backend_native_set_seat_id: - * @seat_id: The seat ID - * - * Sets the seat to assign to the libinput context. - * - * For reliable effects, this function must be called before clutter_init(). - */ -void -meta_clutter_backend_native_set_seat_id (const gchar *seat_id) -{ - g_free (evdev_seat_id); - evdev_seat_id = g_strdup (seat_id); -} diff --git a/src/backends/native/meta-clutter-backend-native.h b/src/backends/native/meta-clutter-backend-native.h index 60d20f362..0dfc3e4aa 100644 --- a/src/backends/native/meta-clutter-backend-native.h +++ b/src/backends/native/meta-clutter-backend-native.h @@ -37,6 +37,4 @@ G_DECLARE_FINAL_TYPE (MetaClutterBackendNative, meta_clutter_backend_native, MetaStageNative * meta_clutter_backend_native_get_stage_native (ClutterBackend *backend); -void meta_clutter_backend_native_set_seat_id (const gchar *seat_id); - #endif /* META_CLUTTER_BACKEND_NATIVE_H */ diff --git a/src/backends/native/meta-launcher.c b/src/backends/native/meta-launcher.c index 4dafa8e88..6e4537755 100644 --- a/src/backends/native/meta-launcher.c +++ b/src/backends/native/meta-launcher.c @@ -528,8 +528,6 @@ meta_launcher_new (GError **error) self->impl.sysfs_fds = g_hash_table_new (NULL, NULL); self->session_active = TRUE; - meta_clutter_backend_native_set_seat_id (self->seat_id); - meta_seat_impl_set_device_callbacks (on_evdev_device_open_in_input_impl, on_evdev_device_close_in_input_impl, self);