Commit 171e5fc3 authored by Jonas Ådahl's avatar Jonas Ådahl Committed by Georges Basile Stavracas Neto

udev: Add 'hotplug' event

To be used my the monitor manager to handle hotplugs.

GNOME/mutter#548
GNOME/mutter!525
parent 7b7d8813
......@@ -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),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment