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
This commit is contained in:
parent
9c222c7e5c
commit
6c2f3d1d17
@ -108,6 +108,7 @@ function start() {
|
|||||||
|
|
||||||
function _sessionsLoaded() {
|
function _sessionsLoaded() {
|
||||||
sessionMode.connect('updated', _sessionUpdated);
|
sessionMode.connect('updated', _sessionUpdated);
|
||||||
|
_initializePrefs();
|
||||||
_initializeUI();
|
_initializeUI();
|
||||||
|
|
||||||
shellDBusService = new ShellDBus.GnomeShell();
|
shellDBusService = new ShellDBus.GnomeShell();
|
||||||
@ -116,6 +117,13 @@ function _sessionsLoaded() {
|
|||||||
_sessionUpdated();
|
_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() {
|
function _initializeUI() {
|
||||||
// Ensure ShellWindowTracker and ShellAppUsage are initialized; this will
|
// Ensure ShellWindowTracker and ShellAppUsage are initialized; this will
|
||||||
// also initialize ShellAppSystem first. ShellAppSystem
|
// also initialize ShellAppSystem first. ShellAppSystem
|
||||||
|
20
src/main.c
20
src/main.c
@ -36,8 +36,6 @@ extern GType gnome_shell_plugin_get_type (void);
|
|||||||
#define SHELL_DBUS_SERVICE "org.gnome.Shell"
|
#define SHELL_DBUS_SERVICE "org.gnome.Shell"
|
||||||
#define MAGNIFIER_DBUS_SERVICE "org.gnome.Magnifier"
|
#define MAGNIFIER_DBUS_SERVICE "org.gnome.Magnifier"
|
||||||
|
|
||||||
#define OVERRIDES_SCHEMA "org.gnome.shell.overrides"
|
|
||||||
|
|
||||||
#define WM_NAME "GNOME Shell"
|
#define WM_NAME "GNOME Shell"
|
||||||
#define GNOME_WM_KEYBINDINGS "Mutter,GNOME Shell"
|
#define GNOME_WM_KEYBINDINGS "Mutter,GNOME Shell"
|
||||||
|
|
||||||
@ -171,23 +169,6 @@ shell_dbus_init (gboolean replace)
|
|||||||
g_object_unref (session);
|
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
|
static void
|
||||||
shell_introspection_init (void)
|
shell_introspection_init (void)
|
||||||
{
|
{
|
||||||
@ -436,7 +417,6 @@ main (int argc, char **argv)
|
|||||||
shell_dbus_init (meta_get_replace_current_wm ());
|
shell_dbus_init (meta_get_replace_current_wm ());
|
||||||
shell_a11y_init ();
|
shell_a11y_init ();
|
||||||
shell_perf_log_init ();
|
shell_perf_log_init ();
|
||||||
shell_prefs_init ();
|
|
||||||
shell_introspection_init ();
|
shell_introspection_init ();
|
||||||
shell_fonts_init ();
|
shell_fonts_init ();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user