[gnome-shell] main: Add (hidden) support for static workspaces
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] main: Add (hidden) support for static workspaces
- Date: Sun, 11 Mar 2012 22:04:10 +0000 (UTC)
commit a197ce6f539845cca9ddc04a79974bebc3880547
Author: Florian MÃllner <fmuellner gnome org>
Date: Thu Mar 8 01:29:17 2012 +0100
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
js/ui/main.js | 10 ++++++++++
js/ui/workspaceThumbnail.js | 3 +++
2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index 11dd81f..c90df06 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 79eef04..7553a4c 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]