[gnome-shell] a11y: can_focus=!reactive as a general rule is not true anymore



commit dafa27fccdab00300479c0e8e853664522a10df6
Author: Alejandro PiÃeiro <apinheiro igalia com>
Date:   Fri Aug 17 11:03:23 2012 +0200

    a11y: can_focus=!reactive as a general rule is not true anymore
    
    In some cases can_focus value is taken directly as
    !reactive. But this is not the case anymore, as
    we are interested on navigate on non reactive items
    
    https://bugzilla.gnome.org/show_bug.cgi?id=667439

 js/ui/popupMenu.js |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 0517837..4e7b3ee 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -37,12 +37,13 @@ const PopupBaseMenuItem = new Lang.Class({
                                          activate: true,
                                          hover: true,
                                          sensitive: true,
-                                         style_class: null
+                                         style_class: null,
+                                         can_focus: true
                                        });
         this.actor = new Shell.GenericContainer({ style_class: 'popup-menu-item',
                                                   reactive: params.reactive,
                                                   track_hover: params.reactive,
-                                                  can_focus: params.reactive,
+                                                  can_focus: params.can_focus,
                                                   accessible_role: Atk.Role.MENU_ITEM});
         this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
         this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
@@ -69,10 +70,9 @@ const PopupBaseMenuItem = new Lang.Class({
         }
         if (params.reactive && params.hover)
             this.actor.connect('notify::hover', Lang.bind(this, this._onHoverChanged));
-        if (params.reactive) {
-            this.actor.connect('key-focus-in', Lang.bind(this, this._onKeyFocusIn));
-            this.actor.connect('key-focus-out', Lang.bind(this, this._onKeyFocusOut));
-        }
+
+        this.actor.connect('key-focus-in', Lang.bind(this, this._onKeyFocusIn));
+        this.actor.connect('key-focus-out', Lang.bind(this, this._onKeyFocusOut));
     },
 
     _onStyleChanged: function (actor) {
@@ -395,7 +395,8 @@ const PopupSeparatorMenuItem = new Lang.Class({
     Extends: PopupBaseMenuItem,
 
     _init: function () {
-        this.parent({ reactive: false });
+        this.parent({ reactive: false,
+                      can_focus: false});
 
         this._drawingArea = new St.DrawingArea({ style_class: 'popup-separator-menu-item' });
         this.addActor(this._drawingArea, { span: -1, expand: true });



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]