[gnome-shell] gdm: move focus to first item in list



commit 39d12351ba085c7b7750038f2ba26651dc300c40
Author: Ray Strode <rstrode redhat com>
Date:   Mon Oct 17 02:56:44 2011 -0400

    gdm: move focus to first item in list
    
    This allows the user to just hit when the user
    list first comes up (in many cases).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=657996

 js/gdm/loginDialog.js |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 473b7cb..5b8683d 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -297,6 +297,20 @@ UserList.prototype = {
                                x_align: St.Align.START,
                                y_align: St.Align.MIDDLE });
         this._items = {};
+
+        this.actor.connect('key-focus-in', Lang.bind(this, this._moveFocusToItems));
+    },
+
+    _moveFocusToItems: function() {
+        let hasItems = Object.keys(this._items).length > 0;
+
+        if (!hasItems)
+            return;
+
+        if (global.stage.get_key_focus() != this.actor)
+            return;
+
+        this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
     },
 
     _showItem: function(item) {
@@ -502,6 +516,8 @@ UserList.prototype = {
                                          item.showFocusAnimation(0);
                                      }));
 
+        this._moveFocusToItems();
+
         this.emit('item-added', item);
     },
 



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