[gnome-shell/wip/carlosg/fix-issue-46: 1/8] keyboard: Do key presses on actual key press



commit 0608413b9679d7277494c2f14f62cb2ed9acefc1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Feb 14 12:39:27 2018 +0100

    keyboard: Do key presses on actual key press
    
    It was mistakenly connecting twice to the 'released' signal. Also, move
    level changes to key release, since it will be more convenient to hook
    latched states on long press.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/46

 js/ui/keyboard.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 5864fd5f5..270166997 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -807,14 +807,14 @@ var Keyboard = new Lang.Class({
 
             let actor = extraButton.keyButton;
 
+            extraButton.connect('pressed', Lang.bind(this, function() {
+                if (keyval != null)
+                    this._keyboardController.keyvalPress(keyval);
+            }));
             extraButton.connect('released', Lang.bind(this, function() {
                 if (switchToLevel != null)
                     this._onLevelChanged(switchToLevel);
                 else if (keyval != null)
-                    this._keyboardController.keyvalPress(keyval);
-            }));
-            extraButton.connect('released', Lang.bind(this, function() {
-                if (keyval != null)
                     this._keyboardController.keyvalRelease(keyval);
                 else if (action == 'hide')
                     this.hide();


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