From 9496b64c8631ea08b5213eb9f47a667679b9a316 Mon Sep 17 00:00:00 2001 From: Marina Zhurakhinskaya Date: Thu, 8 Sep 2011 01:15:09 -0400 Subject: [PATCH] messageTray: hide the summary box pointer if all its notifications are destroyed This ensures that we don't show an animation of an empty blob being hidden when clicking an action button causes the notification to be destroyed. https://bugzilla.gnome.org/show_bug.cgi?id=658525 --- js/ui/messageTray.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 5ddc079c3..f2721cf1b 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -2237,7 +2237,7 @@ MessageTray.prototype = { _showSummaryBoxPointer: function() { this._summaryBoxPointerItem = this._clickedSummaryItem; this._summaryBoxPointerContentUpdatedId = this._summaryBoxPointerItem.connect('content-updated', - Lang.bind(this, this._adjustSummaryBoxPointerPosition)); + Lang.bind(this, this._onSummaryBoxPointerContentUpdated)); this._summaryBoxPointerDoneDisplayingId = this._summaryBoxPointerItem.connect('done-displaying-content', Lang.bind(this, this._escapeTray)); if (this._clickedSummaryItemMouseButton == 1) { @@ -2272,6 +2272,13 @@ MessageTray.prototype = { })); }, + _onSummaryBoxPointerContentUpdated: function() { + if (this._summaryBoxPointerItem.notificationStack.get_children().length == 0) + this._hideSummaryBoxPointer(); + this._adjustSummaryBoxPointerPosition(); + + }, + _adjustSummaryBoxPointerPosition: function() { // The position of the arrow origin should be the same as center of this._clickedSummaryItem.actor if (!this._clickedSummaryItem) @@ -2295,6 +2302,14 @@ MessageTray.prototype = { }, _hideSummaryBoxPointer: function() { + // We should be sure to hide the box pointer if all notifications in it are destroyed while + // it is hiding, so that we don't show an an animation of an empty blob being hidden. + if (this._summaryBoxPointerState == State.HIDING && + this._summaryBoxPointerItem.notificationStack.get_children().length == 0) { + this._summaryBoxPointer.actor.hide(); + return; + } + this._summaryBoxPointerState = State.HIDING; // Unset this._clickedSummaryItem if we are no longer showing the summary if (this._summaryState != State.SHOWN)