From d5f95db68d566f882c4d984e03780a573425ea6c Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 20 May 2013 14:05:59 -0400 Subject: [PATCH] messageTray: Hide notifications when the tray is summoned If the user summons the tray, it should take priority over a notification showing. https://bugzilla.gnome.org/show_bug.cgi?id=700639 --- js/ui/messageTray.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 28eef9294..fb3623e55 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -2218,8 +2218,10 @@ const MessageTray = new Lang.Class({ !(this._notification && this._notification.focused) && !this._pointerInNotification; let notificationLockedOut = !hasNotifications && this._notification; - let notificationMustClose = this._notificationRemoved || notificationLockedOut || (notificationExpired && this._userActiveWhileNotificationShown) || this._notificationClosed; - let canShowNotification = notificationsPending && this._trayState == State.HIDDEN; + let notificationMustClose = (this._notificationRemoved || notificationLockedOut || + (notificationExpired && this._userActiveWhileNotificationShown) || + this._notificationClosed || this._traySummoned); + let canShowNotification = notificationsPending && this._trayState == State.HIDDEN && !this._traySummoned; if (this._notificationState == State.HIDDEN) { if (canShowNotification) @@ -2233,8 +2235,6 @@ const MessageTray = new Lang.Class({ this._ensureNotificationFocused(); } - let mustHideTray = this._notificationState != State.HIDDEN || !hasNotifications; - // Summary notification let haveClickedSummaryItem = this._clickedSummaryItem != null; let summarySourceIsMainNotificationSource = (haveClickedSummaryItem && this._notification && @@ -2264,7 +2264,7 @@ const MessageTray = new Lang.Class({ // Tray itself let trayIsVisible = (this._trayState == State.SHOWING || this._trayState == State.SHOWN); - let trayShouldBeVisible = this._traySummoned && !this._keyboardVisible && !mustHideTray; + let trayShouldBeVisible = this._traySummoned && !this._keyboardVisible && hasNotifications; if (!trayIsVisible && trayShouldBeVisible) trayShouldBeVisible = this._showTray(); else if (trayIsVisible && !trayShouldBeVisible)