messageTray: Move focus ourselves when entering by keybinding

When the tray is triggered by keybinding rather than dwelling, the
first summary item should be given key focus. Currently this is
achieved by grabbing the focus before toggling the tray, so that
the grabHelper will move the focus for us. However this interferes
with the grabHelper's focus save/restore mechanism - for instance,
after using the keybinding once, the tray will always come up with
the first item focused.

https://bugzilla.gnome.org/show_bug.cgi?id=682243
This commit is contained in:
Florian Müllner 2012-09-15 23:01:56 +02:00
parent f2af0be9ac
commit 6ef3c628e6

View File

@ -1715,10 +1715,8 @@ const MessageTray = new Lang.Class({
},
toggleAndNavigate: function() {
// Grab the key focus so that GrabHelper knows
// that we have the key grab.
this._summary.grab_key_focus();
this.toggle();
this._summary.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
},
hide: function() {