[gnome-shell/T27795: 77/138] Allow returning to desktop when clicking on an empty overview area



commit 3eb8deb1eb106a6c1425c54df8c21f5de2904ced
Author: Mario Sanchez Prada <mario endlessm com>
Date:   Wed Jun 7 21:49:01 2017 +0100

    Allow returning to desktop when clicking on an empty overview area
    
    This allows exiting the window picker mode by clicking any empty
    space in the overview (i.e. outside any cloned window).

 js/ui/viewSelector.js   | 5 +++++
 js/ui/workspacesView.js | 2 ++
 2 files changed, 7 insertions(+)
---
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 58eab12e39..ebfb1d6e48 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -162,6 +162,7 @@ var ViewSelector = class {
         this._capturedEventId = 0;
 
         this._workspacesDisplay = new WorkspacesView.WorkspacesDisplay();
+        this._workspacesDisplay.connect('empty-space-clicked', this._onEmptySpaceClicked.bind(this));
         this._workspacesPage = this._addPage(this._workspacesDisplay.actor,
                                              _("Windows"), 'focus-windows-symbolic');
 
@@ -255,6 +256,10 @@ var ViewSelector = class {
             Main.overview.show();
     }
 
+    _onEmptySpaceClicked() {
+        this.setActivePage(ViewPage.APPS);
+    }
+
     showApps() {
         Main.overview.show();
     }
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 172d2d4905..4f3e5735a9 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -465,6 +465,8 @@ var WorkspacesDisplay = class {
             if ((action.get_button() == 1 || action.get_button() == 0) &&
                 this._workspacesViews[index].getActiveWorkspace().isEmpty())
                 Main.overview.hide();
+
+            this.emit('empty-space-clicked');
         });
         Main.overview.addAction(clickAction);
         this.actor.bind_property('mapped', clickAction, 'enabled', GObject.BindingFlags.SYNC_CREATE);


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