gnome-shell/gnome-shell-jsc#SLE-16051-Input-method-recommendation.patch
Dominique Leuenberger 1b181cf557 Accepting request 879701 from home:qzhao:branches:GNOME:Factory
Update gnome-shell-jsc#SLE-16051-Input-method-recommendation.patch: Modify the Japanese input engine load order which will more fit for our community (bnc#1183475);

OBS-URL: https://build.opensuse.org/request/show/879701
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-shell?expand=0&rev=467
2021-03-18 18:31:50 +00:00

38 lines
1.8 KiB
Diff

diff -Nura gnome-shell-3.38.3/js/ui/status/keyboard.js gnome-shell-3.38.3_new/js/ui/status/keyboard.js
--- gnome-shell-3.38.3/js/ui/status/keyboard.js 2021-01-15 01:51:55.673968800 +0800
+++ gnome-shell-3.38.3_new/js/ui/status/keyboard.js 2021-03-17 19:01:52.594128367 +0800
@@ -264,6 +264,33 @@
this._settings.connect('changed::%s'.format(this._KEY_INPUT_SOURCES), this._emitInputSourcesChanged.bind(this));
this._settings.connect('changed::%s'.format(this._KEY_KEYBOARD_OPTIONS), this._emitKeyboardOptionsChanged.bind(this));
this._settings.connect('changed::%s'.format(this._KEY_PER_WINDOW), this._emitPerWindowChanged.bind(this));
+
+ let sources = this._settings.get_value(this._KEY_INPUT_SOURCES);
+ let nSources = sources.n_children();
+ let sourcesList = [];
+
+ if (nSources <= 1) {
+ if (GLib.getenv('LANG') == 'zh_CN.UTF-8') {
+ log('Set default input method in Chinese language env.');
+ sourcesList.push(['xkb', 'cn']);
+ sourcesList.push([ "ibus", "libpinyin" ]);
+ }
+
+ else if (GLib.getenv('LANG') == 'ja_JP.UTF-8') {
+ log('Set default input method in Japanese language env.');
+ sourcesList.push([ "ibus", "mozc-jp" ]);
+ sourcesList.push(['xkb', 'jp']);
+ }
+
+ else if (GLib.getenv('LANG') == 'ko_KR.UTF-8') {
+ log('Set default input method in Korean language env.');
+ sourcesList.push(['xkb', 'kr']);
+ sourcesList.push([ "ibus", "hangul" ]);
+ }
+
+ let params = GLib.Variant.new('a(ss)', sourcesList);
+ this._settings.set_value(this._KEY_INPUT_SOURCES, params);
+ }
}
_getSourcesList(key) {