[Overview] Fix click handling of open panes

The top part of the application pane closes the pane, while outside
the menu only the workspace area accepts clicks for closing the pane.
Let the user close the pane by clicking anywhere outside the menu, but
not inside.

https://bugzilla.gnome.org/show_bug.cgi?id=611641
This commit is contained in:
Florian Müllner 2010-03-04 00:10:16 +01:00
parent 40b0459174
commit fe0f4060c4
2 changed files with 13 additions and 6 deletions

View File

@ -87,7 +87,8 @@ AllAppDisplay.prototype = {
Main.queueDeferredWork(this._workId); Main.queueDeferredWork(this._workId);
})); }));
let bin = new St.BoxLayout({ style_class: 'all-app-controls-panel' }); let bin = new St.BoxLayout({ style_class: 'all-app-controls-panel',
reactive: true });
this.actor = new St.BoxLayout({ style_class: 'all-app', vertical: true }); this.actor = new St.BoxLayout({ style_class: 'all-app', vertical: true });
this.actor.hide(); this.actor.hide();

View File

@ -372,9 +372,8 @@ Overview.prototype = {
})); }));
} }
this._transparentBackground.set_position(this._paneContainer.x, this._paneContainer.y); this._transparentBackground.set_position(primary.x, primary.y);
this._transparentBackground.set_size(primary.width - this._paneContainer.x, this._transparentBackground.set_size(primary.width, primary.height);
this._paneContainer.height);
}, },
@ -391,9 +390,16 @@ Overview.prototype = {
this._transparentBackground.raise_top(); this._transparentBackground.raise_top();
this._paneContainer.raise_top(); this._paneContainer.raise_top();
this._paneContainer.show(); this._paneContainer.show();
this._paneReady = false;
if (backgroundEventId != null) if (backgroundEventId != null)
this._transparentBackground.disconnect(backgroundEventId); this._transparentBackground.disconnect(backgroundEventId);
backgroundEventId = this._transparentBackground.connect('button-release-event', Lang.bind(this, function () { backgroundEventId = this._transparentBackground.connect('captured-event', Lang.bind(this, function (actor, event) {
if (event.get_source() != this._transparentBackground)
return false;
if (event.type() == Clutter.EventType.BUTTON_PRESS)
this._paneReady = true;
if (event.type() == Clutter.EventType.BUTTON_RELEASE
&& this._paneReady)
this._activeDisplayPane.close(); this._activeDisplayPane.close();
return true; return true;
})); }));