[mutter] backends: Pass seat ID to evdev ClutterDeviceManager
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] backends: Pass seat ID to evdev ClutterDeviceManager
- Date: Thu, 2 Feb 2017 22:41:43 +0000 (UTC)
commit 9c79a1631dccc70db529ef57e6a4fd97cf25b043
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Feb 2 19:01:25 2017 +0100
backends: Pass seat ID to evdev ClutterDeviceManager
Clutter assumed seat0 which is most usually, but not always correct.
Add an evdev-backend specific function to allow passing the seat
that will be used for ClutterDeviceManager construction, which we
already obtain in MetaLauncher.
https://bugzilla.gnome.org/show_bug.cgi?id=778092
.../clutter/evdev/clutter-device-manager-evdev.c | 19 ++++++++++++++++++-
clutter/clutter/evdev/clutter-evdev.h | 3 +++
src/backends/native/meta-launcher.c | 2 ++
3 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/clutter/clutter/evdev/clutter-device-manager-evdev.c
b/clutter/clutter/evdev/clutter-device-manager-evdev.c
index ab1b21a..2a3c768 100644
--- a/clutter/clutter/evdev/clutter-device-manager-evdev.c
+++ b/clutter/clutter/evdev/clutter-device-manager-evdev.c
@@ -124,6 +124,7 @@ G_DEFINE_TYPE_WITH_CODE (ClutterDeviceManagerEvdev,
static ClutterOpenDeviceCallback device_open_callback;
static ClutterCloseDeviceCallback device_close_callback;
static gpointer device_callback_data;
+static gchar * evdev_seat_id;
#ifdef CLUTTER_ENABLE_DEBUG
static const char *device_type_str[] = {
@@ -2045,7 +2046,8 @@ clutter_device_manager_evdev_constructed (GObject *gobject)
return;
}
- if (libinput_udev_assign_seat (priv->libinput, "seat0") == -1)
+ if (libinput_udev_assign_seat (priv->libinput,
+ evdev_seat_id ? evdev_seat_id : "seat0") == -1)
{
g_critical ("Failed to assign a seat to the libinput object.");
libinput_unref (priv->libinput);
@@ -2794,3 +2796,18 @@ clutter_evdev_warp_pointer (ClutterInputDevice *pointer_device,
{
notify_absolute_motion (pointer_device, ms2us(time_), x, y, NULL);
}
+
+/**
+ * clutter_evdev_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
+clutter_evdev_set_seat_id (const gchar *seat_id)
+{
+ g_free (evdev_seat_id);
+ evdev_seat_id = g_strdup (seat_id);
+}
diff --git a/clutter/clutter/evdev/clutter-evdev.h b/clutter/clutter/evdev/clutter-evdev.h
index 8e8f8d9..e17ec12 100644
--- a/clutter/clutter/evdev/clutter-evdev.h
+++ b/clutter/clutter/evdev/clutter-evdev.h
@@ -57,6 +57,9 @@ void clutter_evdev_set_device_callbacks (ClutterOpenDeviceCallback open_callba
ClutterCloseDeviceCallback close_callback,
gpointer user_data);
+CLUTTER_AVAILABLE_IN_ALL
+void clutter_evdev_set_seat_id (const gchar *seat_id);
+
CLUTTER_AVAILABLE_IN_1_10
void clutter_evdev_release_devices (void);
CLUTTER_AVAILABLE_IN_1_10
diff --git a/src/backends/native/meta-launcher.c b/src/backends/native/meta-launcher.c
index abba17e..75d07ce 100644
--- a/src/backends/native/meta-launcher.c
+++ b/src/backends/native/meta-launcher.c
@@ -545,6 +545,8 @@ meta_launcher_new (GError **error)
self->kms_fd = kms_fd;
self->kms_file_path = kms_file_path;
+ clutter_evdev_set_seat_id (seat_id);
+
clutter_evdev_set_device_callbacks (on_evdev_device_open,
on_evdev_device_close,
self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]