diff --git a/js/misc/keyboardManager.js b/js/misc/keyboardManager.js index 29fc3b761..142e2f419 100644 --- a/js/misc/keyboardManager.js +++ b/js/misc/keyboardManager.js @@ -156,4 +156,8 @@ var KeyboardManager = class { let options = this._xkbOptions.join(','); return options; } + + get currentLayout() { + return this._current; + } }; diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js index e34b60313..bc50f3d37 100644 --- a/js/ui/status/keyboard.js +++ b/js/ui/status/keyboard.js @@ -772,6 +772,10 @@ var InputSourceManager = class { get inputSources() { return this._inputSources; } + + get keyboardManager() { + return this._keyboardManager; + } }; Signals.addSignalMethods(InputSourceManager.prototype); @@ -1059,6 +1063,14 @@ class InputSourceIndicator extends PanelMenu.Button { xkbLayout = engineDesc.get_layout(); xkbVariant = engineDesc.get_layout_variant(); } + + // The `default` layout from ibus engine means to + // use the current keyboard layout. + if (xkbLayout === 'default') { + const current = this._inputSourceManager.keyboardManager.currentLayout; + xkbLayout = current.layout; + xkbVariant = current.variant; + } } if (!xkbLayout || xkbLayout.length == 0)