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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1689>
This commit is contained in:
Jonas Ådahl 2021-01-19 11:06:40 +01:00 committed by Marge Bot
parent 2d2521a106
commit 6ecdf03efb
3 changed files with 6 additions and 22 deletions

View File

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

View File

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

View File

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