[gnome-shell] messageTray: Clean up code a tiny bit



commit 16547fb3c22fb9072a1320ed51628c56d3a6c84e
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Mar 11 17:11:51 2013 -0400

    messageTray: Clean up code a tiny bit
    
    Remove some duplication by reusing a method.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695659

 js/ui/messageTray.js |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 83a0425..2c1f328 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -2620,10 +2620,9 @@ const MessageTray = new Lang.Class({
     },
 
     _expandNotification: function(autoExpanding) {
-        // Don't grab focus in notifications that are auto-expanded.
+        // Don't focus notifications that are auto-expanding.
         if (!autoExpanding)
-            this._grabHelper.grab({ actor: this._notification.actor,
-                                    grabFocus: true });
+            this._ensureNotificationFocused();
 
         if (!this._notificationExpandedId)
             this._notificationExpandedId =
@@ -2653,8 +2652,6 @@ const MessageTray = new Lang.Class({
         }
     },
 
-    // We use this function to grab focus when the user moves the pointer
-    // to a notification with CRITICAL urgency that was already auto-expanded.
     _ensureNotificationFocused: function() {
         this._grabHelper.grab({ actor: this._notification.actor,
                                 grabFocus: true });


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