util: Place spawned processes into a systemd scope
This improves the separation from the shell for applications launched with Alt+F2 and in a few other cases. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/863
This commit is contained in:
parent
086ba11621
commit
4a6c2f1fe6
@ -3,7 +3,7 @@
|
|||||||
formatTime, formatTimeSpan, createTimeLabel, insertSorted,
|
formatTime, formatTimeSpan, createTimeLabel, insertSorted,
|
||||||
makeCloseButton, ensureActorVisibleInScrollView, wiggle */
|
makeCloseButton, ensureActorVisibleInScrollView, wiggle */
|
||||||
|
|
||||||
const { Clutter, Gio, GLib, GObject, Shell, St } = imports.gi;
|
const { Clutter, Gio, GLib, GObject, Shell, St, GnomeDesktop } = imports.gi;
|
||||||
const Gettext = imports.gettext;
|
const Gettext = imports.gettext;
|
||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
@ -126,6 +126,10 @@ function trySpawn(argv) {
|
|||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Async call, we don't need the reply though
|
||||||
|
GnomeDesktop.start_systemd_scope(argv[0], pid, null, null, null, () => {});
|
||||||
|
|
||||||
// Dummy child watch; we don't want to double-fork internally
|
// Dummy child watch; we don't want to double-fork internally
|
||||||
// because then we lose the parent-child relationship, which
|
// because then we lose the parent-child relationship, which
|
||||||
// can break polkit. See https://bugzilla.redhat.com//show_bug.cgi?id=819275
|
// can break polkit. See https://bugzilla.redhat.com//show_bug.cgi?id=819275
|
||||||
|
Loading…
Reference in New Issue
Block a user