main: Add (hidden) support for static workspaces
The dynamic-workspaces key was introduced to allow us to opt out of writing the num-workspaces setting (which is ignored with the dynamic workspace management anyway), but there'll be some expectations that the setting will have an effect on the UI. It's actually not very hard to support, so here's to the graybeards ... https://bugzilla.gnome.org/show_bug.cgi?id=671568
This commit is contained in:
parent
9dcdaf05b5
commit
a197ce6f53
@ -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 &&
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user