gdk/wayland: Look for font settings recursively
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 18 Feb 2021 15:12:53 +0000 (16:12 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 18 Feb 2021 15:50:45 +0000 (16:50 +0100)
Use the infrastructure already available to look up keys, instead.
This does the right thing and looks up the setting across all
sources.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3680
gdk/wayland/gdkdisplay-wayland.c

index 41e8b5f5a7e6de6d1e48c884848703fc457baa64..88fab19d55ba9b608c1c6db2653e0cd571c6fa0f 100644 (file)
@@ -1590,15 +1590,11 @@ update_xft_settings (GdkDisplay *display)
     }
   else
     {
-      GSettingsSchemaSource *source;
-      GSettingsSchema *schema;
+      TranslationEntry *entry;
 
-      source = g_settings_schema_source_get_default ();
-      schema = g_settings_schema_source_lookup (source,
-                                                "org.gnome.desktop.interface",
-                                                FALSE);
+      entry = find_translation_entry_by_schema ("org.gnome.desktop.interface", "font-antialiasing");
 
-      if (schema && g_settings_schema_has_key (schema, "font-antialiasing"))
+      if (entry && entry->valid)
         {
           settings = g_hash_table_lookup (display_wayland->settings,
                                           "org.gnome.desktop.interface");
@@ -1622,9 +1618,6 @@ update_xft_settings (GdkDisplay *display)
           order = GSD_FONT_RGBA_ORDER_RGB;
         }
 
-      if (schema)
-        g_settings_schema_unref (schema);
-
       dpi = get_dpi_from_gsettings (display_wayland) * 1024;
     }