windowManager: Handle starting/stopping of X11 services

We now do 2 things along Xwayland startup/shutdown:
- Start or stop the gnome-session-x11-services target, that will
  pull all X11 related services that the session might depend on.
- As we start ibus-daemon manually, trigger a restart in order to
  toggle the XIM daemon on and off along with Xwayland presence.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/680
This commit is contained in:
Carlos Garnacho 2019-08-15 13:29:53 +02:00 committed by Carlos Garnacho
parent 8be95b5785
commit 8adfc5b106
2 changed files with 11 additions and 1 deletions

View File

@ -61,7 +61,7 @@ var IBusManager = class {
_spawn(extraArgs = []) {
try {
let cmdLine = ['ibus-daemon', '--panel', 'disable', '--xim', ...extraArgs];
let cmdLine = ['ibus-daemon', '--panel', 'disable', ...extraArgs];
Gio.Subprocess.new(cmdLine, Gio.SubprocessFlags.NONE);
} catch (e) {
log(`Failed to launch ibus-daemon: ${e.message}`);

View File

@ -17,6 +17,7 @@ const PadOsd = imports.ui.padOsd;
const EdgeDragAction = imports.ui.edgeDragAction;
const CloseDialog = imports.ui.closeDialog;
const SwitchMonitor = imports.ui.switchMonitor;
const IBusManager = imports.misc.ibusManager;
const { loadInterfaceXML } = imports.misc.fileUtils;
@ -1041,6 +1042,15 @@ var WindowManager = class {
}
});
global.display.connect('x11-display-opened', () => {
IBusManager.getIBusManager().restartDaemon(['--xim']);
Shell.util_start_systemd_unit('gnome-session-x11-services.target', 'fail');
});
global.display.connect('x11-display-closing', () => {
Shell.util_stop_systemd_unit('gnome-session-x11-services.target', 'fail');
IBusManager.getIBusManager().restartDaemon();
});
Main.overview.connect('showing', () => {
for (let i = 0; i < this._dimmedWindows.length; i++)
this._undimWindow(this._dimmedWindows[i]);