From cbb54e9388f30cce5d00d62066e3a3f23fd2cb98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Fri, 26 Apr 2024 14:19:10 +0200 Subject: [PATCH] keyboard: Set level back to default after commit even when there are hints If the shift key was pressed, we should switch back to the default level after the next commit. It seems that this only worked due to a superfluous signal emission so far (see https://gitlab.gnome.org/GNOME/mutter/-/issues/3448). After a commit, if there are content hints, we call _updateLevelFromHints(), assuming that will switch the level back to "default", but it only does that in case the LOWERCASE content hint is set. So we need to add extra handling here for the case where shift is pressed and content hints exist. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7714 --- js/ui/keyboard.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 70101e93d..4cb0c6e91 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1505,10 +1505,14 @@ export const Keyboard = GObject.registerClass({ this._disableAllModifiers(); if (layout.mode === 'default' || (layout.mode === 'latched' && !this._latched)) { - if (this._contentHint !== 0) + if (this._contentHint !== 0) { + if (layout.mode === 'latched' && !this._latched) + this._setActiveLevel('default'); + this._updateLevelFromHints(); - else + } else { this._setActiveLevel('default'); + } } }).catch(console.error); });