[gnome-shell/wip/pressure: 7/14] grabHelper: Explicitly grab the key focus if we can't navigate inside
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/pressure: 7/14] grabHelper: Explicitly grab the key focus if we can't navigate inside
- Date: Mon, 30 Jul 2012 23:49:31 +0000 (UTC)
commit b676423e2638aed4812bd06dae4bb6f042672245
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Feb 28 15:03:05 2012 -0500
grabHelper: Explicitly grab the key focus if we can't navigate inside
GrabHelper assumes that we've always grabbed the key focus if we've called
navigate. If the widget or any of its descendents are focusable, that's
a bogus assumption. Fix it by explicitly grabbing the key focus if we've
failed to navigate inside the widget.
https://bugzilla.gnome.org/show_bug.cgi?id=671001
js/ui/grabHelper.js | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/grabHelper.js b/js/ui/grabHelper.js
index eb4205d..cd2c12e 100644
--- a/js/ui/grabHelper.js
+++ b/js/ui/grabHelper.js
@@ -124,8 +124,10 @@ const GrabHelper = new Lang.Class({
}
}
- if (newFocus)
- newFocus.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
+ if (newFocus) {
+ if (!newFocus.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false))
+ newFocus.grab_key_focus();
+ }
this._capturedEventId = global.stage.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
this._eventId = global.stage.connect('event', Lang.bind(this, this._onEvent));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]