keyboard: Don't press and release keyval if it's a modifier key
Looks like we currently do the press-and-release dance for keys that specify both a keyval and the "modifier" action. So when pressing CTRL in the extended OSK, not only is the CTRL modifier set together with the next key pressed, but the actual CTRL keyval quickly gets pressed and released, similar to how we'd do it for the TAB key. This seems unintentional, as the press-and-release behavior should probably be specific to keys like TAB, and not apply to modifier keys, so limit that behavior to only keys without an action specified. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3286>
This commit is contained in:
parent
91ffc4c06b
commit
cae8b745ca
@ -1491,28 +1491,6 @@ export const Keyboard = GObject.registerClass({
|
||||
keyval: key.keyval,
|
||||
}, strings);
|
||||
|
||||
if (key.keyval) {
|
||||
button.connect('keyval', (_actor, keyval) => {
|
||||
this._keyboardController.keyvalPress(keyval);
|
||||
this._keyboardController.keyvalRelease(keyval);
|
||||
});
|
||||
}
|
||||
|
||||
if (key.action !== 'modifier') {
|
||||
button.connect('commit', (_actor, str) => {
|
||||
this._keyboardController.commit(str, this._modifiers).then(() => {
|
||||
this._disableAllModifiers();
|
||||
if (layout.mode === 'default' ||
|
||||
(layout.mode === 'latched' && !this._latched)) {
|
||||
if (this._contentHint !== 0)
|
||||
this._updateLevelFromHints();
|
||||
else
|
||||
this._setActiveLevel('default');
|
||||
}
|
||||
}).catch(console.error);
|
||||
});
|
||||
}
|
||||
|
||||
if (key.action) {
|
||||
button.connect('released', () => {
|
||||
if (key.action === 'hide') {
|
||||
@ -1535,6 +1513,24 @@ export const Keyboard = GObject.registerClass({
|
||||
|
||||
this._longPressed = false;
|
||||
});
|
||||
} else if (key.keyval) {
|
||||
button.connect('keyval', (_actor, keyval) => {
|
||||
this._keyboardController.keyvalPress(keyval);
|
||||
this._keyboardController.keyvalRelease(keyval);
|
||||
});
|
||||
} else {
|
||||
button.connect('commit', (_actor, str) => {
|
||||
this._keyboardController.commit(str, this._modifiers).then(() => {
|
||||
this._disableAllModifiers();
|
||||
if (layout.mode === 'default' ||
|
||||
(layout.mode === 'latched' && !this._latched)) {
|
||||
if (this._contentHint !== 0)
|
||||
this._updateLevelFromHints();
|
||||
else
|
||||
this._setActiveLevel('default');
|
||||
}
|
||||
}).catch(console.error);
|
||||
});
|
||||
}
|
||||
|
||||
if (key.action === 'levelSwitch' &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user