Blame SOURCES/0001-main-Actually-respect-hasWorkspaces.patch

b97e22
From 9472b2a2d951be19df5069cca073ab7e7085c769 Mon Sep 17 00:00:00 2001
b97e22
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
b97e22
Date: Fri, 1 Nov 2013 00:49:22 +0100
b97e22
Subject: [PATCH] main: Actually respect hasWorkspaces
b97e22
b97e22
We've long had the hasWorkspaces property, but it doesn't seem like
b97e22
it was ever used. Implement it so that we don't have workspaces in
b97e22
initial-setup mode.
b97e22
---
b97e22
 js/ui/main.js          |  2 +-
b97e22
 js/ui/windowManager.js | 14 +++++++++++++-
b97e22
 2 files changed, 14 insertions(+), 2 deletions(-)
b97e22
b97e22
diff --git a/js/ui/main.js b/js/ui/main.js
b97e22
index bd5dc47..2f0e28a 100644
b97e22
--- a/js/ui/main.js
b97e22
+++ b/js/ui/main.js
b97e22
@@ -233,7 +233,7 @@ function _checkWorkspaces() {
b97e22
     let i;
b97e22
     let emptyWorkspaces = [];
b97e22
 
b97e22
-    if (!Meta.prefs_get_dynamic_workspaces()) {
b97e22
+    if (!sessionMode.hasWorkspaces || !Meta.prefs_get_dynamic_workspaces()) {
b97e22
         _checkWorkspacesId = 0;
b97e22
         return false;
b97e22
     }
b97e22
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
b97e22
index b8ea36b..e4de557 100644
b97e22
--- a/js/ui/windowManager.js
b97e22
+++ b/js/ui/windowManager.js
b97e22
@@ -568,7 +568,7 @@ const WindowManager = new Lang.Class({
b97e22
     },
b97e22
 
b97e22
     _switchWorkspace : function(shellwm, from, to, direction) {
b97e22
-        if (!this._shouldAnimate()) {
b97e22
+        if (!Main.sessionMode.hasWorkspaces || !this._shouldAnimate()) {
b97e22
             shellwm.completed_switch_workspace();
b97e22
             return;
b97e22
         }
b97e22
@@ -721,6 +721,9 @@ const WindowManager = new Lang.Class({
b97e22
     },
b97e22
 
b97e22
     _showWorkspaceSwitcher : function(display, screen, window, binding) {
b97e22
+        if (!Main.sessionMode.hasWorkspaces)
b97e22
+            return;
b97e22
+
b97e22
         if (screen.n_workspaces == 1)
b97e22
             return;
b97e22
 
b97e22
@@ -738,6 +741,9 @@ const WindowManager = new Lang.Class({
b97e22
         else
b97e22
             newWs = this.actionMoveWindow(window, direction);
b97e22
 
b97e22
+        if (!newWs)
b97e22
+            return;
b97e22
+
b97e22
         if (!Main.overview.visible) {
b97e22
             if (this._workspaceSwitcherPopup == null) {
b97e22
                 this._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup();
b97e22
@@ -750,6 +756,9 @@ const WindowManager = new Lang.Class({
b97e22
     },
b97e22
 
b97e22
     actionMoveWorkspace: function(direction) {
b97e22
+        if (!Main.sessionMode.hasWorkspaces)
b97e22
+            return null;
b97e22
+
b97e22
         let activeWorkspace = global.screen.get_active_workspace();
b97e22
         let toActivate = activeWorkspace.get_neighbor(direction);
b97e22
 
b97e22
@@ -760,6 +769,9 @@ const WindowManager = new Lang.Class({
b97e22
     },
b97e22
 
b97e22
     actionMoveWindow: function(window, direction) {
b97e22
+        if (!Main.sessionMode.hasWorkspaces)
b97e22
+            return null;
b97e22
+
b97e22
         let activeWorkspace = global.screen.get_active_workspace();
b97e22
         let toActivate = activeWorkspace.get_neighbor(direction);
b97e22
 
b97e22
-- 
b97e22
1.8.3.1
b97e22