messageTray: Make sure to always grab focus

If a widget isn't focusable or none of its children are focusable, then
navigate_focus will return false and the key focus won't be set. We
need to explicitly grab the key focus in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=671001
This commit is contained in:
Jasper St. Pierre 2012-02-29 19:30:43 -05:00
parent b0d161faad
commit 7d29e691a4

View File

@ -261,7 +261,9 @@ const FocusGrabber = new Lang.Class({
this._hasFocus = true;
this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
if (!this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false))
this.actor.grab_key_focus();
this.emit('focus-grabbed');
},