[gnome-shell] grabHelper: Merge _navigateActor() with its only user
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] grabHelper: Merge _navigateActor() with its only user
- Date: Thu, 14 Feb 2013 18:17:56 +0000 (UTC)
commit ad1b9b71aed4f387222a98a3a58385a4c3857ff0
Author: Florian MÃllner <fmuellner gnome org>
Date: Mon Feb 11 17:52:09 2013 +0100
grabHelper: Merge _navigateActor() with its only user
https://bugzilla.gnome.org/show_bug.cgi?id=693570
js/ui/grabHelper.js | 19 +++++--------------
1 files changed, 5 insertions(+), 14 deletions(-)
---
diff --git a/js/ui/grabHelper.js b/js/ui/grabHelper.js
index fe3a121..50effdb 100644
--- a/js/ui/grabHelper.js
+++ b/js/ui/grabHelper.js
@@ -10,17 +10,6 @@ const St = imports.gi.St;
const Main = imports.ui.main;
const Params = imports.misc.params;
-function _navigateActor(actor) {
- if (!actor)
- return;
-
- let needsGrab = true;
- if (actor instanceof St.Widget)
- needsGrab = !actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
- if (needsGrab)
- actor.grab_key_focus();
-}
-
// GrabHelper:
// @owner: the actor that owns the GrabHelper
// @params: optional parameters to pass to Main.pushModal()
@@ -178,10 +167,12 @@ const GrabHelper = new Lang.Class({
if (params.grabFocus && !this._takeFocusGrab(hadFocus))
return false;
- if (params.focus)
+ if (params.focus) {
params.focus.grab_key_focus();
- else if (hadFocus || params.grabFocus)
- _navigateActor(newFocus);
+ } else if (newFocus && (hadFocus || params.grabFocus)) {
+ if (!newFocus.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false))
+ newFocus.grab_key_focus();
+ }
if ((params.grabFocus || params.modal) && !this._capturedEventId)
this._capturedEventId = global.stage.connect('captured-event', Lang.bind(this,
this._onCapturedEvent));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]