[gnome-shell] Don't activate workspace when more than one window is open



commit 2016e08f7b9fde6744c2bb4c18711290c99e4413
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Sun Mar 7 19:33:58 2010 +0100

    Don't activate workspace when more than one window is open
    
    Currently clicking on an empty spot on the workspace actors switches to the workspace, this has a side effect that when for some reason (like using a touchpad),
    the user misses the window he intends to open he will end up with the currently focused window instead.
    
    Disable this behaviour if more than one window is open (in that case the user has to explicitly target a specific window).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=610868

 js/ui/workspace.js |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 4c440de..4d9bf30 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -639,8 +639,13 @@ Workspace.prototype = {
         this._desktop.connect('selected',
                               Lang.bind(this,
                                         function(clone, time) {
-                                            this._metaWorkspace.activate(time);
-                                            Main.overview.hide();
+                                            // Only switch to the workspace when one window is open
+                                            // We check for "2" here because the Desktop does not really count
+                                            // as a window in this context.
+                                            if (this._windows.length <= 2) {
+                                                this._metaWorkspace.activate(time);
+                                                Main.overview.hide();
+                                            }
                                         }));
         this.actor.add_actor(this._desktop.actor);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]