[gnome-shell/gnome-3-8] main: Move pref overrides to JS



commit bcede26d77bfe568a588ec3098f54408ff75965c
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Jun 6 16:39:23 2013 +0200

    main: Move pref overrides to JS
    
    We will allow to use mode-specific overrides; in preparation for that,
    move the code so that we only override preferences after initializing
    the session mode.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=701717

 js/ui/main.js |    7 +++++++
 src/main.c    |   20 --------------------
 2 files changed, 7 insertions(+), 20 deletions(-)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index f438114..2c5217c 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -106,6 +106,7 @@ function start() {
 
 function _sessionsLoaded() {
     sessionMode.connect('updated', _sessionUpdated);
+    _initializePrefs();
     _initializeUI();
 
     shellDBusService = new ShellDBus.GnomeShell();
@@ -114,6 +115,12 @@ function _sessionsLoaded() {
     _sessionUpdated();
 }
 
+function _initializePrefs() {
+    let keys = new Gio.Settings({ schema: OVERRIDES_SCHEMA }).list_keys();
+    for (let i = 0; i < keys.length; i++)
+        Meta.prefs_override_preference_schema (keys[i], OVERRIDES_SCHEMA);
+}
+
 function _initializeUI() {
     // Ensure ShellWindowTracker and ShellAppUsage are initialized; this will
     // also initialize ShellAppSystem first.  ShellAppSystem
diff --git a/src/main.c b/src/main.c
index ca2116a..9f7f890 100644
--- a/src/main.c
+++ b/src/main.c
@@ -36,8 +36,6 @@ extern GType gnome_shell_plugin_get_type (void);
 #define SHELL_DBUS_SERVICE "org.gnome.Shell"
 #define MAGNIFIER_DBUS_SERVICE "org.gnome.Magnifier"
 
-#define OVERRIDES_SCHEMA "org.gnome.shell.overrides"
-
 #define WM_NAME "GNOME Shell"
 #define GNOME_WM_KEYBINDINGS "Mutter,GNOME Shell"
 
@@ -167,23 +165,6 @@ shell_dbus_init (gboolean replace)
 }
 
 static void
-shell_prefs_init (void)
-{
-  meta_prefs_override_preference_schema ("attach-modal-dialogs",
-                                         OVERRIDES_SCHEMA);
-  meta_prefs_override_preference_schema ("dynamic-workspaces",
-                                         OVERRIDES_SCHEMA);
-  meta_prefs_override_preference_schema ("workspaces-only-on-primary",
-                                         OVERRIDES_SCHEMA);
-  meta_prefs_override_preference_schema ("button-layout",
-                                         OVERRIDES_SCHEMA);
-  meta_prefs_override_preference_schema ("edge-tiling",
-                                         OVERRIDES_SCHEMA);
-  meta_prefs_override_preference_schema ("focus-change-on-pointer-rest",
-                                         OVERRIDES_SCHEMA);
-}
-
-static void
 shell_introspection_init (void)
 {
 
@@ -409,7 +390,6 @@ main (int argc, char **argv)
   shell_dbus_init (meta_get_replace_current_wm ());
   shell_a11y_init ();
   shell_perf_log_init ();
-  shell_prefs_init ();
   shell_introspection_init ();
   shell_fonts_init ();
 


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