From 7c3c6da36809eed49a2b93b4fb669143a7e93640 Mon Sep 17 00:00:00 2001 From: Tanner Doshier Date: Wed, 22 Aug 2012 19:01:04 -0500 Subject: [PATCH] overview: Connect item-drag signals to show/hide overview elements Anytime we begin dragging an app launcher, ensure the overview elements are showing. While searching, if an item-drag ends or is cancelled, hide the overview elements, but don't switch back to windows (which was the old behavior). https://bugzilla.gnome.org/show_bug.cgi?id=682050 --- js/ui/overview.js | 21 +++++++++++++++++---- js/ui/viewSelector.js | 3 --- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/js/ui/overview.js b/js/ui/overview.js index 19bb1c826..abd6bdf25 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -270,14 +270,27 @@ const Overview = new Lang.Class({ this._viewSelector.connect('page-changed', Lang.bind(this, function() { - this._setSideControlsVisibility(); + this._setSideControlsVisibility(false); + })); + + this.connect('item-drag-begin', Lang.bind(this, + function() { + this._setSideControlsVisibility(true); + })); + this.connect('item-drag-cancelled', Lang.bind(this, + function() { + this._setSideControlsVisibility(false); + })); + this.connect('item-drag-end', Lang.bind(this, + function() { + this._setSideControlsVisibility(false); })); Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._relayout)); this._relayout(); }, - _setSideControlsVisibility: function() { + _setSideControlsVisibility: function(inDrag) { // Ignore the case when we're leaving the overview, since // actors will be made visible again when entering the overview // next time, and animating them while doing so is just @@ -286,8 +299,8 @@ const Overview = new Lang.Class({ return; let searchActive = this._viewSelector.getSearchActive(); - let dashVisible = !searchActive; - let thumbnailsVisible = !searchActive; + let dashVisible = !searchActive || inDrag; + let thumbnailsVisible = !searchActive || inDrag; let trayVisible = !searchActive; if (dashVisible) diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index 2b45f3707..94ea78f65 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -118,9 +118,6 @@ const ViewSelector = new Lang.Class({ global.focus_manager.add_group(this._searchResults.actor); - Main.overview.connect('item-drag-begin', - Lang.bind(this, this._resetShowAppsButton)); - this._stageKeyPressId = 0; Main.overview.connect('showing', Lang.bind(this, function () {