Make popdown,popup methods idempotent; remove 'popdown' for 'cancelled'

Callers will generally expect _popup and _popdown to be a no-op if
the menu is already in that state; make it so.

Also change the 'popdown' signal to be 'cancelled'; this is
clearer and allows us to avoid having activate also call popdown.

https://bugzilla.gnome.org/show_bug.cgi?id=594699
This commit is contained in:
Colin Walters
2009-09-11 17:16:49 -04:00
parent 05c99241d6
commit 7ac9fb2dd0
2 changed files with 42 additions and 15 deletions

View File

@ -502,9 +502,9 @@ WellMenu.prototype = {
padding: 4,
corner_radius: WELL_MENU_CORNER_RADIUS,
width: Main.overview._dash.actor.width * 0.75 });
this._windowContainer.connect('popdown', Lang.bind(this, this._onPopdown));
this._windowContainer.connect('unselected', Lang.bind(this, this._onWindowUnselected));
this._windowContainer.connect('selected', Lang.bind(this, this._onWindowSelected));
this._windowContainer.connect('cancelled', Lang.bind(this, this._onWindowSelectionCancelled));
this._windowContainer.connect('activate', Lang.bind(this, this._onWindowActivate));
this.actor.add_actor(this._windowContainer);
@ -655,9 +655,11 @@ WellMenu.prototype = {
_onWindowActivate: function (actor, child) {
let window = child._window;
Main.overview.activateWindow(window, Clutter.get_current_event_time());
this.emit('popup', false);
this.actor.hide();
},
_onPopdown: function () {
_onWindowSelectionCancelled: function () {
this.emit('highlight-window', null);
this.emit('popup', false);
this.actor.hide();