From 23787e391d2e490b6d703a106f5d89d8a940c3c2 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 8 Sep 2023 18:51:34 +0200 Subject: [PATCH] keyboard: Reset latched levels on string commit on all situations The _commitAction() paths have early returns, which made resetting the latched mode inconsistent depending on the paths taken to commit the string. This made latched modes not return to normal on e.g. Shell entries. Make this happen outside the function, and after the only calling point, so that the level is correctly reset on all situations. Part-of: (cherry picked from commit 08f3ad3835877ec4073d72ba2dc3f563183a9ecc) --- 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 b3c4cbe32..b492a401a 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1527,7 +1527,10 @@ var Keyboard = GObject.registerClass({ if (key.action !== 'modifier') { button.connect('commit', (_actor, keyval, str) => { - this._commitAction(keyval, str); + this._commitAction(keyval, str).then(() => { + if (!this._latched) + this._setActiveLayer(0); + }); }); } @@ -1607,9 +1610,6 @@ var Keyboard = GObject.registerClass({ }); } } - - if (!this._latched) - this._setActiveLayer(0); } _previousWordPosition(text, cursor) {