udev: Fetch seat-id via backend instead of laucher

Configurations where we won't have a MetaLauncher will be added, so
avoid using its API directly.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1689>
This commit is contained in:
Jonas Ådahl 2021-01-18 22:38:21 +01:00 committed by Marge Bot
parent 41246cb31d
commit 8de3190627
3 changed files with 9 additions and 3 deletions

View File

@ -314,6 +314,12 @@ meta_backend_native_lock_layout_group (MetaBackend *backend,
meta_backend_notify_keymap_layout_group_changed (backend, idx);
}
const char *
meta_backend_native_get_seat_id (MetaBackendNative *backend_native)
{
return meta_launcher_get_seat_id (backend_native->launcher);
}
static void
meta_backend_native_set_pointer_constraint (MetaBackend *backend,
MetaPointerConstraint *constraint)

View File

@ -47,4 +47,6 @@ MetaUdev * meta_backend_native_get_udev (MetaBackendNative *native);
MetaKms * meta_backend_native_get_kms (MetaBackendNative *native);
const char * meta_backend_native_get_seat_id (MetaBackendNative *backend_native);
#endif /* META_BACKEND_NATIVE_H */

View File

@ -111,8 +111,6 @@ gboolean
meta_udev_is_drm_device (MetaUdev *udev,
GUdevDevice *device)
{
MetaLauncher *launcher =
meta_backend_native_get_launcher (udev->backend_native);
const char *seat_id;
const char *device_type;
const char *device_seat;
@ -133,7 +131,7 @@ meta_udev_is_drm_device (MetaUdev *udev,
}
/* Skip devices that do not belong to our seat. */
seat_id = meta_launcher_get_seat_id (launcher);
seat_id = meta_backend_native_get_seat_id (udev->backend_native);
if (g_strcmp0 (seat_id, device_seat))
return FALSE;