keyboard: Try harder to find a matching layout
While we support a reasonable list of layouts nowadays, we don't
include many variants like `fr+oss`. Instead of directly falling
back to the `us` layout, try stripping the variant first, as the
base layout is likely closer to the expectation than `us`.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1907
(cherry picked from commit c1ec7b2ffa
)
This commit is contained in:
parent
9b0d42309b
commit
64b62de5df
@ -466,10 +466,17 @@ Signals.addSignalMethods(Key.prototype);
|
|||||||
|
|
||||||
var KeyboardModel = class {
|
var KeyboardModel = class {
|
||||||
constructor(groupName) {
|
constructor(groupName) {
|
||||||
|
let names = [groupName];
|
||||||
|
if (names.includes('+'))
|
||||||
|
names.push(groupName.replace(/\+.*/, ''));
|
||||||
|
names.push('us');
|
||||||
|
|
||||||
|
for (let i = 0; i < names.length; i++) {
|
||||||
try {
|
try {
|
||||||
this._model = this._loadModel(groupName);
|
this._model = this._loadModel(names[i]);
|
||||||
|
break;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this._model = this._loadModel('us');
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user