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
This commit is contained in:
Jonas Dreßler 2024-04-26 14:19:10 +02:00
parent 0cdddaa4a7
commit cbb54e9388

View file

@ -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);
});