[mutter] udev: Add 'hotplug' event
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] udev: Add 'hotplug' event
- Date: Thu, 20 Jun 2019 13:47:35 +0000 (UTC)
commit 171e5fc3c2382e58aa4791954d6f589aabede241
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu Jan 10 19:03:01 2019 +0100
udev: Add 'hotplug' event
To be used my the monitor manager to handle hotplugs.
https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
src/backends/native/meta-udev.c | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/src/backends/native/meta-udev.c b/src/backends/native/meta-udev.c
index b36001eac..489ca0948 100644
--- a/src/backends/native/meta-udev.c
+++ b/src/backends/native/meta-udev.c
@@ -29,6 +29,7 @@
enum
{
+ HOTPLUG,
DEVICE_ADDED,
N_SIGNALS
@@ -162,6 +163,9 @@ on_uevent (GUdevClient *client,
if (g_str_equal (action, "add"))
g_signal_emit (udev, signals[DEVICE_ADDED], 0, device);
+
+ if (g_udev_device_get_property_as_boolean (device, "HOTPLUG"))
+ g_signal_emit (udev, signals[HOTPLUG], 0);
}
GUdevClient *
@@ -210,6 +214,13 @@ meta_udev_class_init (MetaUdevClass *klass)
object_class->finalize = meta_udev_finalize;
+ signals[HOTPLUG] =
+ g_signal_new ("hotplug",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0, NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
signals[DEVICE_ADDED] =
g_signal_new ("device-added",
G_TYPE_FROM_CLASS (object_class),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]