messageTray: Grab the key focus when entering from the keybinding

This commit is contained in:
Jasper St. Pierre 2012-08-15 13:42:31 -04:00
parent c33e2d1971
commit c668d16a00

View File

@ -1423,7 +1423,7 @@ const MessageTray = new Lang.Class({
global.display.add_keybinding('toggle-message-tray', global.display.add_keybinding('toggle-message-tray',
new Gio.Settings({ schema: SHELL_KEYBINDINGS_SCHEMA }), new Gio.Settings({ schema: SHELL_KEYBINDINGS_SCHEMA }),
Meta.KeyBindingFlags.NONE, Meta.KeyBindingFlags.NONE,
Lang.bind(this, this.toggle)); Lang.bind(this, this.toggleAndNavigate));
this._summaryItems = []; this._summaryItems = [];
this._chatSummaryItemsCount = 0; this._chatSummaryItemsCount = 0;
@ -1575,6 +1575,13 @@ const MessageTray = new Lang.Class({
this._updateState(); this._updateState();
}, },
toggleAndNavigate: function() {
// Grab the key focus so that GrabHelper knows
// that we have the key grab.
this._summary.grab_key_focus();
this.toggle();
},
hide: function() { hide: function() {
this._traySummoned = false; this._traySummoned = false;
this.actor.set_hover(false); this.actor.set_hover(false);