mirror of
https://github.com/brl/mutter.git
synced 2024-12-03 21:30:41 -05:00
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:
parent
49501c28f2
commit
ea00c96044
@ -626,8 +626,9 @@ meta_kms_resume (MetaKms *kms)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_udev_hotplug (MetaUdev *udev,
|
on_udev_hotplug (MetaUdev *udev,
|
||||||
MetaKms *kms)
|
GUdevDevice *udev_device,
|
||||||
|
MetaKms *kms)
|
||||||
{
|
{
|
||||||
handle_hotplug_event (kms);
|
handle_hotplug_event (kms);
|
||||||
}
|
}
|
||||||
|
@ -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),
|
||||||
|
Loading…
Reference in New Issue
Block a user