Commit 6c2f3d1d authored by Florian Müllner's avatar Florian Müllner
Browse files

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
parent 9c222c7e
......@@ -108,6 +108,7 @@ function start() {
function _sessionsLoaded() {
sessionMode.connect('updated', _sessionUpdated);
_initializePrefs();
_initializeUI();
shellDBusService = new ShellDBus.GnomeShell();
......@@ -116,6 +117,13 @@ function _sessionsLoaded() {
_sessionUpdated();
}
function _initializePrefs() {
let overridesSchema = 'org.gnome.shell.overrides';
let keys = new Gio.Settings({ schema: overridesSchema }).list_keys();
for (let i = 0; i < keys.length; i++)
Meta.prefs_override_preference_schema(keys[i], overridesSchema);
}
function _initializeUI() {
// Ensure ShellWindowTracker and ShellAppUsage are initialized; this will
// also initialize ShellAppSystem first. ShellAppSystem
......
......@@ -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"
......@@ -171,23 +169,6 @@ shell_dbus_init (gboolean replace)
g_object_unref (session);
}
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)
{
......@@ -436,7 +417,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 ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment