[gnome-shell/gnome-3-30] popupMenu: Handle keypress if numlock is enabled



commit c17ba90209efa31b63df7c64a373c093eb33cca5
Author: Andrea Azzarone <andrea azzarone canonical com>
Date:   Wed Sep 12 20:13:04 2018 +0000

    popupMenu: Handle keypress if numlock is enabled
    
    Add exception to handle a keypress if numlock is enabled as we already do for
    capslock. This uses Clutter.ModifierType.MOD2_MASK because at the moment there
    is not a more explicit way to refer to the numlock mask.
    
    Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/550
    
    
    (cherry picked from commit 88556226669067585bf05c8d78624a072c41b98f)

 js/ui/popupMenu.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index f449d6e7e..0b2cce856 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -143,9 +143,10 @@ var PopupBaseMenuItem = new Lang.Class({
     _onKeyPressEvent(actor, event) {
         let state = event.get_state();
 
-        // if user has a modifier down (except capslock)
+        // if user has a modifier down (except capslock and numlock)
         // then don't handle the key press here
         state &= ~Clutter.ModifierType.LOCK_MASK;
+        state &= ~Clutter.ModifierType.MOD2_MASK;
         state &= Clutter.ModifierType.MODIFIER_MASK;
 
         if (state)


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