keyboard: Support OSK layout modes explicitly

We only support "latched" which stays toggled on for a single
character unless long-pressed. Support "default" mode explicitly
to switch back to the default level, leaving "locked" implicitly
supported as the way to stay in the same level.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
This commit is contained in:
Carlos Garnacho 2024-01-29 15:44:38 +01:00
parent 81670e1543
commit 4d71d9f46d

View File

@ -1440,7 +1440,8 @@ export const Keyboard = GObject.registerClass({
if (key.action !== 'modifier') {
button.connect('commit', (_actor, keyval, str) => {
this._commitAction(keyval, str).then(() => {
if (layout.mode === 'latched' && !this._latched)
if (layout.mode === 'default' ||
(layout.mode === 'latched' && !this._latched))
this._setActiveLevel('default');
});
});