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
fbf1ee8a01
commit
bcede26d77
@ -106,6 +106,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();
|
||||||
@ -114,6 +115,12 @@ function _sessionsLoaded() {
|
|||||||
_sessionUpdated();
|
_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() {
|
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"
|
||||||
|
|
||||||
@ -166,23 +164,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)
|
||||||
{
|
{
|
||||||
@ -409,7 +390,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…
x
Reference in New Issue
Block a user