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
This commit is contained in:
Tanner Doshier 2012-08-22 19:01:04 -05:00 committed by Cosimo Cecchi
parent 09e7ab5611
commit 7c3c6da368
2 changed files with 17 additions and 7 deletions

View File

@ -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)

View File

@ -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 () {