[gnome-shell] messageTray: Don't hide the banner after NOTIFICATION_TIMEOUT



commit ca4b86e7ca88a0a2cce890ba1431fee73f9c8ca6
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Sep 3 18:29:39 2012 +0200

    messageTray: Don't hide the banner after NOTIFICATION_TIMEOUT
    
    ... if the notification originally popped up under the pointer, and
    the pointer is moving inside it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682238

 js/ui/messageTray.js |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 22a28b5..32223c5 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -2135,9 +2135,10 @@ const MessageTray = new Lang.Class({
         // explicitly mouses away from it and then mouses back in.
         this._showNotificationMouseX = x;
         this._showNotificationMouseY = y;
-        // We save the y coordinate of the mouse at the time when we started showing the notification
-        // and then we update it in _notifiationTimeout() if the mouse is moving towards the
-        // notification. We don't pop down the notification if the mouse is moving towards it.
+        // We save the coordinates of the mouse at the time when we started showing the notification
+        // and then we update it in _notificationTimeout(). We don't pop down the notification if
+        // the mouse is moving towards it or within it.
+        this._lastSeenMouseX = x;
         this._lastSeenMouseY = y;
     },
 
@@ -2205,13 +2206,20 @@ const MessageTray = new Lang.Class({
             // hide it yet. (We just create a new timeout (and destroy
             // the old one) each time because the bookkeeping is
             // simpler.)
-            this._lastSeenMouseY = y;
+            this._updateNotificationTimeout(1000);
+        } else if (this._useLongerTrayLeftTimeout && !this._trayLeftTimeoutId &&
+                  (x != this._lastSeenMouseX || y != this._lastSeenMouseY)) {
+            // Refresh the timeout if the notification originally
+            // popped up under the pointer, and the pointer is hovering
+            // inside it.
             this._updateNotificationTimeout(1000);
         } else {
             this._notificationTimeoutId = 0;
             this._updateState();
         }
 
+        this._lastSeenMouseX = x;
+        this._lastSeenMouseY = y;
         return false;
     },
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]