ibusManager: Use setup X11 display for ibus-x11

(re)spawning ibus to get ibus-x11 will be part atm of Xwayland
initialization process. For it to be set up before the client
it needs using the GNOME_SETUP_DISPLAY.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/836
This commit is contained in:
Carlos Garnacho 2020-02-29 18:43:28 +01:00
parent e4f9efc134
commit 3c4a5a67e2

View File

@ -61,7 +61,12 @@ var IBusManager = class {
_spawn(extraArgs = []) { _spawn(extraArgs = []) {
try { try {
let cmdLine = ['ibus-daemon', '--panel', 'disable', ...extraArgs]; let cmdLine = ['ibus-daemon', '--panel', 'disable', ...extraArgs];
Gio.Subprocess.new(cmdLine, Gio.SubprocessFlags.NONE); let launcher = Gio.SubprocessLauncher.new(Gio.SubprocessFlags.NONE);
// Forward the right X11 Display for ibus-x11
let display = GLib.getenv('GNOME_SETUP_DISPLAY');
if (display)
launcher.setenv('DISPLAY', display, true);
launcher.launch(cmdLine);
} catch (e) { } catch (e) {
log(`Failed to launch ibus-daemon: ${e.message}`); log(`Failed to launch ibus-daemon: ${e.message}`);
} }