udev: Pass the device as parameter on hotplug events

This will allow to find the related MetaKmsDevice that is emitting the
hotplug event

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1964>
This commit is contained in:
Marco Trevisan (Treviño) 2020-08-04 19:14:05 +02:00 committed by Marge Bot
parent 49501c28f2
commit ea00c96044
2 changed files with 6 additions and 4 deletions

View File

@ -627,6 +627,7 @@ meta_kms_resume (MetaKms *kms)
static void static void
on_udev_hotplug (MetaUdev *udev, on_udev_hotplug (MetaUdev *udev,
GUdevDevice *udev_device,
MetaKms *kms) MetaKms *kms)
{ {
handle_hotplug_event (kms); handle_hotplug_event (kms);

View File

@ -208,7 +208,7 @@ on_uevent (GUdevClient *client,
g_signal_emit (udev, signals[DEVICE_REMOVED], 0, device); g_signal_emit (udev, signals[DEVICE_REMOVED], 0, device);
if (g_udev_device_get_property_as_boolean (device, "HOTPLUG")) if (g_udev_device_get_property_as_boolean (device, "HOTPLUG"))
g_signal_emit (udev, signals[HOTPLUG], 0); g_signal_emit (udev, signals[HOTPLUG], 0, device);
} }
MetaUdev * MetaUdev *
@ -256,7 +256,8 @@ meta_udev_class_init (MetaUdevClass *klass)
G_TYPE_FROM_CLASS (object_class), G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL, 0, NULL, NULL, NULL,
G_TYPE_NONE, 0); G_TYPE_NONE, 1,
G_UDEV_TYPE_DEVICE);
signals[DEVICE_ADDED] = signals[DEVICE_ADDED] =
g_signal_new ("device-added", g_signal_new ("device-added",
G_TYPE_FROM_CLASS (object_class), G_TYPE_FROM_CLASS (object_class),