From bc3b890e75d77ea39755b93353547cf5f39fa006 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 8 Sep 2023 19:01:29 +0200 Subject: [PATCH] keyboard: Only reset to the default level on unlocked latched levels Reportedly, non-alphanumeric key levels were able to stick by happenstance, and let the user press multiple keys until explicitly switching to a different mode. Reportedly, this broke, switching to the default level after the first key press on the additional levels. Since we have this information in the OSK key models (each level has a "mode" field to either default/latched/locked), retrieve this information for them for each level, and only reset to the default level if on one of those latched levels, and the relevant key was not locked through long-press. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5763 Part-of: --- js/ui/keyboard.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index e029d0a7f..3adf230fd 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1498,6 +1498,7 @@ export const Keyboard = GObject.registerClass({ let layout = new KeyContainer(); layout.shiftKeys = []; + layout.mode = currentLevel.mode; this._loadRows(currentLevel, level, levels.length, layout); layers[level] = layout; @@ -1534,7 +1535,7 @@ export const Keyboard = GObject.registerClass({ if (key.action !== 'modifier') { button.connect('commit', (_actor, keyval, str) => { this._commitAction(keyval, str).then(() => { - if (!this._latched) + if (layout.mode === 'latched' && !this._latched) this._setActiveLayer(0); }); });