[gnome-shell] popupMenu: Implement vfunc's for key focus in/out



commit bdf66d7b62b383045ddbc039138c542224670895
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date:   Fri Apr 12 15:46:10 2019 -0500

    popupMenu: Implement vfunc's for key focus in/out
    
    As per the fact the menu item is an object we can just vfunc's.
    This is not possible for events as specific union object is passed instead of
    just the Clutter.Event.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/499

 js/ui/popupMenu.js | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 8cb0650d7..d068394e2 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -95,9 +95,6 @@ var PopupBaseMenuItem = GObject.registerClass({
         }
         if (params.reactive && params.hover)
             this.connect('notify::hover', this._onHoverChanged.bind(this));
-
-        this.connect('key-focus-in', this._onKeyFocusIn.bind(this));
-        this.connect('key-focus-out', this._onKeyFocusOut.bind(this));
     }
 
     get actor() {
@@ -161,11 +158,13 @@ var PopupBaseMenuItem = GObject.registerClass({
         return Clutter.EVENT_PROPAGATE;
     }
 
-    _onKeyFocusIn(actor) {
+    vfunc_key_focus_in() {
+        super.vfunc_key_focus_in();
         this.setActive(true);
     }
 
-    _onKeyFocusOut(actor) {
+    vfunc_key_focus_out() {
+        super.vfunc_key_focus_out();
         this.setActive(false);
     }
 


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