From 24b05bb41429b673aef6fd4fd5dba39ba5e4b739 Mon Sep 17 00:00:00 2001 From: Leo Date: Wed, 4 Dec 2024 18:17:12 +0300 Subject: [PATCH] Wayland: start gnome-session-x11-services-ready.target (#2140) --- src/WindowManager.vala | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/WindowManager.vala b/src/WindowManager.vala index 974aee56..3b2d08ef 100644 --- a/src/WindowManager.vala +++ b/src/WindowManager.vala @@ -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 ();