Commit 1b28cdfb authored by Takao Fujiwara's avatar Takao Fujiwara Committed by Florian Müllner

keyboard: Do not call KeyboardManager.holdKeyboard() with set-content-type

When gnome-shell receives the signal of 'set-content-type' from ibus,
gnome-shell calls KeyboardManager.holdKeyboard() and
KeyboardManager.releaseKeyboard() and the functions change the current
input focus in GNOME Xorg and it could result in closing a popup window
which has a password entry by focusing on the entry.
The solution is to stop to call the APIs on 'set-content-type' signal.


(cherry picked from commit 551e8278)
parent a7329431
......@@ -360,11 +360,14 @@ var InputSourceManager = new Lang.Class({
this._settings.connect('per-window-changed', this._sourcesPerWindowChanged.bind(this));
this._disableIBus = false;
this._reloading = false;
reload() {
this._reloading = true;
this._reloading = false;
_ibusReadyCallback(im, ready) {
......@@ -458,6 +461,14 @@ var InputSourceManager = new Lang.Class({
activateInputSource(is, interactive) {
// 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.
if (!this._reloading)
......@@ -473,7 +484,10 @@ var InputSourceManager = new Lang.Class({
engine = 'xkb:us::eng';
if (!this._reloading)
this._ibusManager.setEngine(engine, KeyboardManager.releaseKeyboard);
if (interactive)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment