From 57812546b96b6c7d797f7fd4a383503439324f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Szcz=C4=99k?= Date: Mon, 30 Sep 2024 11:24:32 +0200 Subject: [PATCH] udev: Use current tags when looking for preferred primary devices In some use cases there is a need to dynamically change the preferred primary GPU, or get rid of the preference altogether. This is currently not possible due to a change in udev introduced by systemd v247. This version made the tags "sticky", meaning there is no way to remove them once attached. When a tag gets removed, only the CURRENT_TAGS property reflects that change, the removed tag will remain in the TAGS property. This also bumps libgudev version to 238, since that version introduces a function, which we need to get the current tags. Related: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1562 Part-of: --- meson.build | 2 +- src/backends/native/meta-udev.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index a4142c21a..2a633bb53 100644 --- a/meson.build +++ b/meson.build @@ -42,7 +42,7 @@ libei_req = '>= 1.0.901' # optional version requirements udev_req = '>= 228' -gudev_req = '>= 232' +gudev_req = '>= 238' # wayland version requirements wayland_server_req = '>= 1.23' diff --git a/src/backends/native/meta-udev.c b/src/backends/native/meta-udev.c index f3cd06ee7..758ee9f53 100644 --- a/src/backends/native/meta-udev.c +++ b/src/backends/native/meta-udev.c @@ -124,9 +124,9 @@ meta_is_udev_test_device (GUdevDevice *device) gboolean meta_is_udev_device_preferred_primary (GUdevDevice *device) { - const char * const * tags; + const char * const *tags; - tags = g_udev_device_get_tags (device); + tags = g_udev_device_get_current_tags (device); if (!tags) return FALSE;