From: Matthias Clasen Date: Thu, 13 Apr 2023 05:23:06 +0000 (+0200) Subject: openuriportal: Detect if the interface isn't there X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~4^2~10^2~20 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d9fbcdb82e0df23e7a613f3739b4ea7e66aa9ad8;p=gtk4.git openuriportal: Detect if the interface isn't there Check the portal version number before trying to use it. Most importantly, this will detect the case where the interface isn't supported at all, since the proxy will report a version of 0 in that case. Fixes: #5733 --- diff --git a/gtk/gtkopenuriportal.c b/gtk/gtkopenuriportal.c index 10001cacf4..1bec7a1cb0 100644 --- a/gtk/gtkopenuriportal.c +++ b/gtk/gtkopenuriportal.c @@ -67,6 +67,12 @@ init_openuri_portal (void) g_error_free (error); } + if (gtk_xdp_open_uri_get_version (openuri) < 3) + { + g_warning ("Not a supported version of the OpenURI portal: %u", gtk_xdp_open_uri_get_version (openuri)); + g_clear_object (&openuri); + } + g_object_unref (connection); } else