Wayland: start gnome-session-x11-services-ready.target (#2140)

This commit is contained in:
Leo 2024-12-04 18:17:12 +03:00 committed by GitHub
parent 869996cd64
commit 24b05bb414
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -148,8 +148,39 @@ namespace Gala {
display.gl_video_memory_purged.connect (() => {
Meta.Background.refresh_all ();
});
#if WITH_SYSTEMD
if (Meta.Util.is_wayland_compositor ()) {
display.init_xserver.connect ((task) => {
start_x11_services.begin (task);
return true;
});
}
#endif
}
#if WITH_SYSTEMD
private async void start_x11_services (GLib.Task task) {
try {
var session_bus = yield GLib.Bus.@get (GLib.BusType.SESSION);
yield session_bus.call (
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
"org.freedesktop.systemd1.Manager",
"StartUnit",
new GLib.Variant ("(ss)", "gnome-session-x11-services-ready.target", "fail"),
new GLib.VariantType ("(o)"),
GLib.DBusCallFlags.NONE,
-1
);
} catch (Error e) {
critical (e.message);
} finally {
task.return_boolean (true);
}
}
#endif
private void show_stage () {
unowned Meta.Display display = get_display ();