diff --git a/js/ui/main.js b/js/ui/main.js index 11dd81f97..c90df0636 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -38,6 +38,7 @@ const XdndHandler = imports.ui.xdndHandler; const StatusIconDispatcher = imports.ui.statusIconDispatcher; const Util = imports.misc.util; +const OVERRIDES_SCHEMA = 'org.gnome.shell.overrides'; const DEFAULT_BACKGROUND_COLOR = new Clutter.Color(); DEFAULT_BACKGROUND_COLOR.from_pixel(0x2266bbff); @@ -71,6 +72,7 @@ let _startDate; let _defaultCssStylesheet = null; let _cssStylesheet = null; let _gdmCssStylesheet = null; +let _overridesSettings = null; let background = null; @@ -250,6 +252,9 @@ function start() { 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); @@ -274,6 +279,11 @@ function _checkWorkspaces() { let i; let emptyWorkspaces = []; + if (!Meta.prefs_get_dynamic_workspaces()) { + _checkWorkspacesId = 0; + return false; + } + for (i = 0; i < _workspaces.length; i++) { let lastRemoved = _workspaces[i]._lastRemovedWindow; if (lastRemoved && diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index 79eef04b5..7553a4c82 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -610,6 +610,9 @@ const ThumbnailsBox = new Lang.Class({ if (!source.realWindow && !source.shellWorkspaceLaunch) return DND.DragMotionResult.CONTINUE; + if (!Meta.prefs_get_dynamic_workspaces()) + return DND.DragMotionResult.CONTINUE; + let spacing = this.actor.get_theme_node().get_length('spacing'); let thumbHeight = this._porthole.height * this._scale;