summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-04-07 14:53:00 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-04-07 14:53:00 -0400
commitbdcad1dab3f7c7749122538b46fbd9ef07cf9e5e (patch)
treea254d92fcb3b7cd63260c4dcbd6b74a9bf424337
parent5710df685b0af9b7dd306dfba6c7e174e428950e (diff)
downloadgtk+-font-settings-fallback-4.tar.gz
wayland: Improve font setting fallback morefont-settings-fallback-4
We may get a response from the portal that contains no useful settings at all. In that case, we should fallback as well. Fixes: #3838
-rw-r--r--gdk/wayland/gdkdisplay-wayland.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index c071b4e4c5..ba36d0bb82 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -1917,6 +1917,14 @@ init_settings (GdkDisplay *display)
g_variant_get (ret, "(a{sa{sv}})", &iter);
+ if (g_variant_n_children (ret) == 0)
+ {
+ g_debug ("Received no portal settings");
+ g_clear_pointer (&ret, g_variant_unref);
+
+ goto fallback;
+ }
+
while (g_variant_iter_loop (iter, "{s@a{sv}}", &schema_str, &val))
{
GVariantIter *iter2 = g_variant_iter_new (val);