diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js index a17e9c43b..1515a1f21 100644 --- a/js/ui/status/keyboard.js +++ b/js/ui/status/keyboard.js @@ -360,11 +360,14 @@ var InputSourceManager = new Lang.Class({ this._settings.connect('per-window-changed', this._sourcesPerWindowChanged.bind(this)); this._sourcesPerWindowChanged(); this._disableIBus = false; + this._reloading = false; }, reload() { + this._reloading = true; this._keyboardManager.setKeyboardOptions(this._settings.keyboardOptions); this._inputSourcesChanged(); + this._reloading = false; }, _ibusReadyCallback(im, ready) { @@ -458,7 +461,15 @@ var InputSourceManager = new Lang.Class({ }, activateInputSource(is, interactive) { - KeyboardManager.holdKeyboard(); + // The focus changes during holdKeyboard/releaseKeyboard may trick + // the client into hiding UI containing the currently focused entry. + // So holdKeyboard/releaseKeyboard are not called when + // 'set-content-type' signal is received. + // E.g. Focusing on a password entry in a popup in Xorg Firefox + // will emit 'set-content-type' signal. + // https://gitlab.gnome.org/GNOME/gnome-shell/issues/391 + if (!this._reloading) + KeyboardManager.holdKeyboard(); this._keyboardManager.apply(is.xkbId); // All the "xkb:..." IBus engines simply "echo" back symbols, @@ -473,7 +484,10 @@ var InputSourceManager = new Lang.Class({ else engine = 'xkb:us::eng'; - this._ibusManager.setEngine(engine, KeyboardManager.releaseKeyboard); + if (!this._reloading) + this._ibusManager.setEngine(engine, KeyboardManager.releaseKeyboard); + else + this._ibusManager.setEngine(engine); this._currentInputSourceChanged(is); if (interactive)