From 24841a8d5b278d45b8ba01361bef56037f0536a1 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 11 Sep 2024 08:53:38 -0300 Subject: [PATCH] a11y: Correct return type of D-Bus call org.freedesktop.DBus.Properties.Get() returns "(v)" which then must be unpacked into an uint32 ("u") variant. --- gtk/a11y/gtkatspiroot.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gtk/a11y/gtkatspiroot.c b/gtk/a11y/gtkatspiroot.c index 2f1c7069c5..6ab349b73a 100644 --- a/gtk/a11y/gtkatspiroot.c +++ b/gtk/a11y/gtkatspiroot.c @@ -597,6 +597,7 @@ static bool check_flatpak_portal_version (GDBusConnection *connection, unsigned int minimum_version) { + GVariant *child; GError *error = NULL; GVariant *res = @@ -606,7 +607,7 @@ check_flatpak_portal_version (GDBusConnection *connection, "org.freedesktop.DBus.Properties", "Get", g_variant_new ("(ss)", "org.freedesktop.portal.Flatpak", "version"), - G_VARIANT_TYPE ("(u)"), + G_VARIANT_TYPE ("(v)"), G_DBUS_CALL_FLAGS_NONE, -1, NULL, @@ -620,10 +621,12 @@ check_flatpak_portal_version (GDBusConnection *connection, return false; } - guint32 version = 0; - g_variant_get (res, "(u)", &version); + g_variant_get (res, "(v)", &child); g_variant_unref (res); + guint32 version = g_variant_get_uint32 (child); + g_variant_unref (child); + GTK_DEBUG (A11Y, "Flatpak portal version: %u (required: %u)", version, minimum_version); return version >= minimum_version;