From 8a86540090b18fbec222e03beb5d2f3fcaec9bf1 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sun, 19 Aug 2012 21:40:09 -0400 Subject: [PATCH] Revert the other half of "St: don't attempt to give focus to non reactive actors" This reverts commit 26d3b1929e2cd9dcedf829a2224857a533040729. https://bugzilla.gnome.org/show_bug.cgi?id=667439 --- js/ui/networkAgent.js | 1 + js/ui/popupMenu.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/js/ui/networkAgent.js b/js/ui/networkAgent.js index f91a4bac5..dbfb75832 100644 --- a/js/ui/networkAgent.js +++ b/js/ui/networkAgent.js @@ -168,6 +168,7 @@ const NetworkSecretDialog = new Lang.Class({ } this._okButton.button.reactive = valid; + this._okButton.button.can_focus = valid; }, _onOk: function() { diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index dcc23d7f2..70c4360bd 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -134,6 +134,7 @@ const PopupBaseMenuItem = new Lang.Class({ this.sensitive = sensitive; this.actor.reactive = sensitive; + this.actor.can_focus = sensitive; this.emit('sensitive-changed', sensitive); }, @@ -717,7 +718,8 @@ const Switch = new Lang.Class({ _init: function(state) { this.actor = new St.Bin({ style_class: 'toggle-switch', - accessible_role: Atk.Role.CHECK_BOX}); + accessible_role: Atk.Role.CHECK_BOX, + can_focus: true }); // Translators: this MUST be either "toggle-switch-us" // (for toggle switches containing the English words // "ON" and "OFF") or "toggle-switch-intl" (for toggle @@ -1876,7 +1878,7 @@ const RemoteMenu = new Lang.Class({ })); } - item.actor.reactive = action.enabled; + item.actor.reactive = item.actor.can_focus = action.enabled; destroyId = item.connect('destroy', Lang.bind(this, function() { item.disconnect(destroyId); @@ -2008,7 +2010,7 @@ const RemoteMenu = new Lang.Class({ if (action.items.length) { for (let i = 0; i < action.items.length; i++) { let item = action.items[i]; - item.actor.reactive = action.enabled; + item.actor.reactive = item.actor.can_focus = action.enabled; } } }