MessageTray: restore opacity when expanding a notification

MessageTray tweens both opacity and y to hide or show _notificationWidget,
but only y when expanding it. This means that an existing tween to hide
the notification will continue running, clearing the notification state.
If the hiding one completes before the showing one, the onComplete handler
will throw an exception (because the notification was nullified) and
therefore break the state tracking.

https://bugzilla.gnome.org/show_bug.cgi?id=683986
This commit is contained in:
Giovanni Campagna 2012-11-19 18:59:39 +01:00
parent e0d127b3e4
commit b121c25184

View File

@ -2403,8 +2403,13 @@ const MessageTray = new Lang.Class({
if (this._notificationWidget.y < expandedY) { if (this._notificationWidget.y < expandedY) {
this._notificationWidget.y = expandedY; this._notificationWidget.y = expandedY;
} else if (this._notification.y != expandedY) { } else if (this._notification.y != expandedY) {
// Tween also opacity here, to override a possible tween that's
// currently hiding the notification. This will ensure that the
// notification is not removed when the onComplete handler for this
// one triggers.
this._tween(this._notificationWidget, '_notificationState', State.SHOWN, this._tween(this._notificationWidget, '_notificationState', State.SHOWN,
{ y: expandedY, { y: expandedY,
opacity: 255,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: 'easeOutQuad' transition: 'easeOutQuad'
}); });