From 3ff194247ab3d16d9a16953f14f84bb4e79b674d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 6 Jun 2013 18:47:56 +0200 Subject: [PATCH] main: Use the correct schema for 'dynamic-workspaces' We currently monitor the shell's override schema for changes to the 'dynamic-workspaces' key, which ends up being the wrong schema in classic mode. With the new ability to use mode-specific overides, we can finally fix this. https://bugzilla.gnome.org/show_bug.cgi?id=701717 --- js/ui/main.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/js/ui/main.js b/js/ui/main.js index 10c9fb597..bd5dc4764 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -38,7 +38,6 @@ const Magnifier = imports.ui.magnifier; const XdndHandler = imports.ui.xdndHandler; const Util = imports.misc.util; -const OVERRIDES_SCHEMA = 'org.gnome.shell.overrides'; const DEFAULT_BACKGROUND_COLOR = Clutter.Color.from_pixel(0x2e3436ff); let componentManager = null; @@ -68,7 +67,7 @@ let layoutManager = null; let _startDate; let _defaultCssStylesheet = null; let _cssStylesheet = null; -let _overridesSettings = null; +let _workspacesSettings = null; function _sessionUpdated() { _loadDefaultStylesheet(); @@ -119,6 +118,15 @@ function _initializePrefs() { let keys = new Gio.Settings({ schema: sessionMode.overridesSchema }).list_keys(); for (let i = 0; i < keys.length; i++) Meta.prefs_override_preference_schema (keys[i], sessionMode.overridesSchema); + + let workspacesSchema; + if (keys.indexOf('dynamic-workspaces') > -1) + workspacesSchema = sessionMode.overridesSchema; + else + workspacesSchema = 'org.gnome.mutter'; + + _workspacesSettings = new Gio.Settings({ schema: workspacesSchema }); + _workspacesSettings.connect('changed::dynamic-workspaces', _queueCheckWorkspaces); } function _initializeUI() { @@ -186,9 +194,6 @@ function _initializeUI() { Scripting.runPerfScript(module, perfOutput); } - _overridesSettings = new Gio.Settings({ schema: OVERRIDES_SCHEMA }); - _overridesSettings.connect('changed::dynamic-workspaces', _queueCheckWorkspaces); - global.screen.connect('notify::n-workspaces', _nWorkspacesChanged); global.screen.connect('window-entered-monitor', _windowEnteredMonitor);