[gnome-shell] windowManager: Actually respect hasWorkspaces
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] windowManager: Actually respect hasWorkspaces
- Date: Thu, 18 Jul 2013 22:04:33 +0000 (UTC)
commit ed178b702f210dc80016dd5928a2f56bb0cfbeee
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sun Jun 16 00:21:21 2013 -0400
windowManager: Actually respect hasWorkspaces
We've long had the hasWorkspaces property, but it doesn't seem like
it was ever used. Implement it so that we don't have workspaces in
initial-setup mode.
Since it's difficult to make it change at runtime with a decent set
of semantics, and we never expect that to happen, don't bother
implementing it dynamically.
https://bugzilla.gnome.org/show_bug.cgi?id=698593
js/ui/windowManager.js | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 022cd1e..d6b0b7a 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -473,13 +473,17 @@ const WindowManager = new Lang.Class({
this._dimWindow(this._dimmedWindows[i]);
}));
- this._workspaceTracker = new WorkspaceTracker(this);
+ if (Main.sessionMode.hasWorkspaces)
+ this._workspaceTracker = new WorkspaceTracker(this);
global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT,
false, -1, 1);
},
keepWorkspaceAlive: function(workspace, duration) {
+ if (!this._workspaceTracker)
+ return;
+
this._workspaceTracker.keepWorkspaceAlive(workspace, duration);
},
@@ -829,7 +833,7 @@ const WindowManager = new Lang.Class({
},
_switchWorkspace : function(shellwm, from, to, direction) {
- if (!this._shouldAnimate()) {
+ if (!Main.sessionMode.hasWorkspaces || !this._shouldAnimate()) {
shellwm.completed_switch_workspace();
return;
}
@@ -982,6 +986,9 @@ const WindowManager = new Lang.Class({
},
_showWorkspaceSwitcher : function(display, screen, window, binding) {
+ if (!Main.sessionMode.hasWorkspaces)
+ return;
+
if (screen.n_workspaces == 1)
return;
@@ -1023,14 +1030,19 @@ const WindowManager = new Lang.Class({
},
actionMoveWorkspace: function(workspace) {
+ if (!Main.sessionMode.hasWorkspaces)
+ return;
+
let activeWorkspace = global.screen.get_active_workspace();
if (activeWorkspace != workspace)
workspace.activate(global.get_current_time());
-
},
actionMoveWindow: function(window, workspace) {
+ if (!Main.sessionMode.hasWorkspaces)
+ return;
+
let activeWorkspace = global.screen.get_active_workspace();
if (activeWorkspace != workspace) {
@@ -1043,6 +1055,5 @@ const WindowManager = new Lang.Class({
global.display.clear_mouse_mode();
workspace.activate_with_focus (window, global.get_current_time());
}
-
},
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]