popupMenu: Overwrite ongoing animations when calling close repeatedly
Currently close() is a no-op when the menu has already been closed. However, repeated calls could pass different animation parameters. For instance in the user menu, we try to hide the menu immediately before locking the screen, to avoid the popup jumping across the screen while fading out - as we do this from the corresponding item's activate handler, the closing is still animated if the menu's own handler (which requests a full animation) is run first. Fix this by changing close() to overwrite ongoing animations before bailing out early. https://bugzilla.gnome.org/show_bug.cgi?id=686484
This commit is contained in:
parent
70dbfb9a56
commit
40efe6c324
@ -141,6 +141,7 @@ const BoxPointer = new Lang.Class({
|
|||||||
|
|
||||||
this._muteInput();
|
this._muteInput();
|
||||||
|
|
||||||
|
Tweener.removeTweens(this);
|
||||||
Tweener.addTween(this, { opacity: fade ? 0 : 255,
|
Tweener.addTween(this, { opacity: fade ? 0 : 255,
|
||||||
xOffset: xOffset,
|
xOffset: xOffset,
|
||||||
yOffset: yOffset,
|
yOffset: yOffset,
|
||||||
|
@ -1269,14 +1269,15 @@ const PopupMenu = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
close: function(animate) {
|
close: function(animate) {
|
||||||
if (!this.isOpen)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (this._activeMenuItem)
|
if (this._activeMenuItem)
|
||||||
this._activeMenuItem.setActive(false);
|
this._activeMenuItem.setActive(false);
|
||||||
|
|
||||||
|
if (this._boxPointer.actor.visible)
|
||||||
this._boxPointer.hide(animate);
|
this._boxPointer.hide(animate);
|
||||||
|
|
||||||
|
if (!this.isOpen)
|
||||||
|
return;
|
||||||
|
|
||||||
this.isOpen = false;
|
this.isOpen = false;
|
||||||
this.emit('open-state-changed', false);
|
this.emit('open-state-changed', false);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user