[epiphany/mcatanzaro/keyfilesettings: 1/2] Fix GSettings use in web process



commit 840da29af6bbe3ed4dad38108cfbae532f03fd31
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Thu Nov 7 16:40:48 2019 -0600

    Fix GSettings use in web process
    
    GSettings was totally busted in the web process since glib 2.60.5,
    except when running under flatpak. That's because our web process
    sandbox creates a .flatpak-info file to trick glib and GTK into using
    portals. Since glib 2.60.5, that also causes glib to use
    GKeyfileSettingsBackend by default rather than dconf. But our code is
    not prepared for this. It's fine if we're actually running under
    flatpak, because then the same keyfile will be used in the UI process as
    well. But outside flatpak, the UI process is using dconf. Our code fails
    to sync the settings, because it thinks it doesn't need to if it's
    already a keyfile backend, and so everything breaks.
    
    Fix this by always syncing code from the default backend to our custom
    backend.
    
    Fixes #993
    
    Also mostly fixes #865, since we were leaking the default
    GKeyfileSettingsBackend in this case (when not under flatpak), causing
    an inotify leak. But I will have a follow-up commit to close this.

 lib/ephy-settings.c | 9 ---------
 1 file changed, 9 deletions(-)
---
diff --git a/lib/ephy-settings.c b/lib/ephy-settings.c
index 2d29b5618..a3a16cf85 100644
--- a/lib/ephy-settings.c
+++ b/lib/ephy-settings.c
@@ -212,15 +212,6 @@ ephy_settings_get_for_web_process_extension (const char *schema)
     gsettings = ephy_settings_get (schema);
     g_assert (gsettings != NULL);
 
-    /* GLib inside Flatpak will default to this backend in the future */
-    /* so we don't need to do anything extra */
-    g_object_get (gsettings, "backend", &backend, NULL);
-    /* G_IS_KEYFILE_SETTINGS_BACKEND () is private API */
-    if (!g_strcmp0 (g_type_name (G_TYPE_FROM_INSTANCE (backend)), "GKeyfileSettingsBackend")) {
-      g_hash_table_insert (settings, g_steal_pointer (&key_name), g_object_ref (gsettings));
-      return gsettings;
-    }
-
     keyfile_path = g_build_filename (ephy_config_dir (), "web-extension-settings.ini", NULL);
     backend = g_keyfile_settings_backend_new (keyfile_path, "/", "/");
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]