ibusManager: Add call to restart the ibus daemon

We may need to restart it with different arguments, so make it
possible to do that. Also, avoid to just restart it on _clear(),
this is now most likely through our --replace call than it is
through ibus-daemon eg. dying, avoids some noise in logs as
there is already an ongoing ibus-daemon.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/680
This commit is contained in:
Carlos Garnacho 2019-08-15 13:28:59 +02:00 committed by Carlos Garnacho
parent 9194de8460
commit 8be95b5785

View File

@ -59,15 +59,19 @@ var IBusManager = class {
this._spawn();
}
_spawn() {
_spawn(extraArgs = []) {
try {
Gio.Subprocess.new(['ibus-daemon', '--xim', '--panel', 'disable'],
Gio.SubprocessFlags.NONE);
let cmdLine = ['ibus-daemon', '--panel', 'disable', '--xim', ...extraArgs];
Gio.Subprocess.new(cmdLine, Gio.SubprocessFlags.NONE);
} catch (e) {
log(`Failed to launch ibus-daemon: ${e.message}`);
}
}
restartDaemon(extraArgs = []) {
this._spawn(['-r', ...extraArgs]);
}
_clear() {
if (this._panelService)
this._panelService.destroy();
@ -80,8 +84,6 @@ var IBusManager = class {
this._currentEngineName = null;
this.emit('ready', false);
this._spawn();
}
_onConnected() {