1
0
Fork 0

core: Query pad devices on MetaPadActionMapper initialization

This object might miss pad devices being made available too early
during seat construction at Mutter initialization, and not initialize
its own backing data properly for these.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3143
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3370>
This commit is contained in:
Carlos Garnacho 2023-11-07 13:22:52 +01:00 committed by Marge Bot
parent 2dec4dd088
commit 91d70ad7a2

View file

@ -157,10 +157,17 @@ device_removed (MetaPadActionMapper *mapper,
static void static void
meta_pad_action_mapper_init (MetaPadActionMapper *mapper) meta_pad_action_mapper_init (MetaPadActionMapper *mapper)
{ {
g_autoptr (GList) devices = NULL;
GList *l;
mapper->pads = g_hash_table_new_full (NULL, NULL, NULL, mapper->pads = g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) pad_mapping_info_free); (GDestroyNotify) pad_mapping_info_free);
mapper->seat = clutter_backend_get_default_seat (clutter_get_default_backend ()); mapper->seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
devices = clutter_seat_list_devices (mapper->seat);
for (l = devices; l; l = l->next)
device_added (mapper, l->data);
} }
MetaPadActionMapper * MetaPadActionMapper *