gnome-shell/gnome-shell-jsc#SLE-16051-Input-method-recommendation.patch
Bjørn Lie 1d2f4517e8 Accepting request 1119168 from home:xiaoguang_wang:branches:GNOME:Factory
- Rebase patches for SLE-15-SP6 (bsc#1216072):
  + Rebase endSession-dialog-update-time-label-every-sec.patch
  + Rebase gnome-shell-disable-ibus-when-not-installed.patch
  + Rebase gnome-shell-domain.patch
  + Rebase gnome-shell-exit-crash-workaround.patch
  + Rebase gnome-shell-fate324570-Make-GDM-background-image-configurable.patch
  + Rebase gnome-shell-gdm-login-applet.patch
  + Rebase gnome-shell-jsc#SLE-16051-Input-method-recommendation.patch
  + Rebase gnome-shell-jscSLE9267-Remove-sessionList-of-endSessionDialog.patch
  + Rebase gnome-shell-screen-disappear.patch
  + Remove aboutMenu.js

OBS-URL: https://build.opensuse.org/request/show/1119168
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-shell?expand=0&rev=547
2023-10-23 14:05:05 +00:00

45 lines
2.0 KiB
Diff

Index: gnome-shell-45.0/js/ui/status/keyboard.js
===================================================================
--- gnome-shell-45.0.orig/js/ui/status/keyboard.js
+++ gnome-shell-45.0/js/ui/status/keyboard.js
@@ -274,6 +274,39 @@ class InputSourceSessionSettings extends
this._settings.connect(`changed::${this._KEY_INPUT_SOURCES}`, this._emitInputSourcesChanged.bind(this));
this._settings.connect(`changed::${this._KEY_KEYBOARD_OPTIONS}`, this._emitKeyboardOptionsChanged.bind(this));
this._settings.connect(`changed::${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" ]);
+
+ let params = GLib.Variant.new('a(ss)', sourcesList);
+ this._settings.set_value(this._KEY_INPUT_SOURCES, params);
+ }
+
+ 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']);
+
+ let params = GLib.Variant.new('a(ss)', sourcesList);
+ this._settings.set_value(this._KEY_INPUT_SOURCES, params);
+ }
+
+ 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) {