messageTray: Fix _hideTray() being called recursively

_hideTray() is called by _updateState() when the tray is visible
but should be hidden; however, _updateState() may be called again
from within _hideTray() when releasing the GrabHelper grab, so
unless we update the _trayState variable before that, _hideTray()
will be called a second time.

https://bugzilla.gnome.org/show_bug.cgi?id=682243
This commit is contained in:
Florian Müllner 2012-09-14 19:23:21 +02:00
parent 94c1d5a18c
commit afcd90ae27

View File

@ -2071,17 +2071,17 @@ const MessageTray = new Lang.Class({
}, },
_hideTray: function() { _hideTray: function() {
// Note that we might have entered here without a grab,
// which would happen if GrabHelper ungrabbed for us.
// This is a no-op in that case.
this._grabHelper.ungrab({ actor: this.actor });
this._tween(this.actor, '_trayState', State.HIDDEN, this._tween(this.actor, '_trayState', State.HIDDEN,
{ y: 0, { y: 0,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: 'easeOutQuad' transition: 'easeOutQuad'
}); });
// Note that we might have entered here without a grab,
// which would happen if GrabHelper ungrabbed for us.
// This is a no-op in that case.
this._grabHelper.ungrab({ actor: this.actor });
// If we are coming back from the overview, there are no windows // If we are coming back from the overview, there are no windows
// to be moved. Just remove the tray from the ctrl+alt+tab list. // to be moved. Just remove the tray from the ctrl+alt+tab list.
if (!this._desktopClone) { if (!this._desktopClone) {