[gnome-shell/wip/carlosg/size-not-length] keyboard: Use the right property to figure out modifiers set size




commit 60209eab9db4f0a5068f4a8869a1ca2edc3fef08
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Aug 23 18:29:09 2022 +0200

    keyboard: Use the right property to figure out modifiers set size
    
    During development of the OSK updates, this._modifiers turned from an
    array into a Set(), but this location missed switching from length()
    to size() to get the cardinality of the contained values.
    
    As a result, the OSK misbehaved and resorted for key event forwarding
    for impossible keyvals, instead of handing them directly to the IM.
    
    Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5766

 js/ui/keyboard.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 4bdac879a9..895691c34e 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -1511,7 +1511,7 @@ var Keyboard = GObject.registerClass({
 
             if (key.action !== 'modifier') {
                 button.connect('commit', (actor, keyval, str) => {
-                    if (this._modifiers.length === 0 && str !== '' &&
+                    if (this._modifiers.size === 0 && str !== '' &&
                         keyval && this._oskCompletionEnabled) {
                         Main.inputMethod.handleVirtualKey(keyval);
                         return;


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