[mutter/wip/carlosg/x11-devices-config: 8/8] backends/x11: Emit CLUTTER_DEVICE_ADDED events for initial devices
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/x11-devices-config: 8/8] backends/x11: Emit CLUTTER_DEVICE_ADDED events for initial devices
- Date: Fri, 6 Nov 2020 21:28:03 +0000 (UTC)
commit 11fb81156e98c23ffe0b0766913eebd0143d2861
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Nov 6 18:00:55 2020 +0100
backends/x11: Emit CLUTTER_DEVICE_ADDED events for initial devices
This is similar to commit b9e5a2d6e23, but for the X11 backend.
src/backends/x11/meta-backend-x11.c | 7 +++++++
src/backends/x11/meta-seat-x11.c | 20 ++++++++++++++++++++
src/backends/x11/meta-seat-x11.h | 2 ++
3 files changed, 29 insertions(+)
---
diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c
index 36349ffbbc..d53deb3861 100644
--- a/src/backends/x11/meta-backend-x11.c
+++ b/src/backends/x11/meta-backend-x11.c
@@ -525,6 +525,8 @@ meta_backend_x11_post_init (MetaBackend *backend)
MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
MetaMonitorManager *monitor_manager;
+ ClutterBackend *clutter_backend;
+ ClutterSeat *seat;
int major, minor;
gboolean has_xi = FALSE;
@@ -577,6 +579,11 @@ meta_backend_x11_post_init (MetaBackend *backend)
priv->touch_replay_sync_atom = XInternAtom (priv->xdisplay,
"_MUTTER_TOUCH_SEQUENCE_SYNC",
False);
+
+ clutter_backend = meta_backend_get_clutter_backend (backend);
+ seat = clutter_backend_get_default_seat (clutter_backend);
+ meta_seat_x11_notify_devices (META_SEAT_X11 (seat),
+ CLUTTER_STAGE (meta_backend_get_stage (backend)));
}
static ClutterBackend *
diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c
index de775e1f91..90ed2b8857 100644
--- a/src/backends/x11/meta-seat-x11.c
+++ b/src/backends/x11/meta-seat-x11.c
@@ -1383,6 +1383,26 @@ meta_seat_x11_get_property (GObject *object,
}
}
+void
+meta_seat_x11_notify_devices (MetaSeatX11 *seat_x11,
+ ClutterStage *stage)
+{
+ GHashTableIter iter;
+ ClutterInputDevice *device;
+
+ g_hash_table_iter_init (&iter, seat_x11->devices_by_id);
+ while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &device))
+ {
+ ClutterEvent *event;
+
+ event = clutter_event_new (CLUTTER_DEVICE_ADDED);
+ clutter_event_set_device (event, device);
+ clutter_event_set_stage (event, stage);
+ clutter_do_event (event);
+ g_print ("aaa %p\n", stage);
+ }
+}
+
static void
meta_seat_x11_constructed (GObject *object)
{
diff --git a/src/backends/x11/meta-seat-x11.h b/src/backends/x11/meta-seat-x11.h
index 0573f64b8c..326db4a459 100644
--- a/src/backends/x11/meta-seat-x11.h
+++ b/src/backends/x11/meta-seat-x11.h
@@ -36,6 +36,8 @@ ClutterInputDevice * meta_seat_x11_lookup_device_id (MetaSeatX11 *seat_x11,
int device_id);
void meta_seat_x11_select_stage_events (MetaSeatX11 *seat,
ClutterStage *stage);
+void meta_seat_x11_notify_devices (MetaSeatX11 *seat_x11,
+ ClutterStage *stage);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]