From ebbf6b6010feaec61a38d7176e578e328f191720 Mon Sep 17 00:00:00 2001 From: Marius Meisenzahl Date: Mon, 30 Oct 2023 10:23:14 +0100 Subject: [PATCH] Gtk.init only in X11 session (#1792) --- src/WindowManager.vala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/WindowManager.vala b/src/WindowManager.vala index ee21b698..1ae7cf30 100644 --- a/src/WindowManager.vala +++ b/src/WindowManager.vala @@ -303,6 +303,13 @@ namespace Gala { // Most things inside this "later" depend on GTK. We get segfaults if we try to do GTK stuff before the window manager // is initialized, so we hold this stuff off until we're ready to draw laters.add (Meta.LaterType.BEFORE_REDRAW, () => { + unowned string xdg_session_type = Environment.get_variable ("XDG_SESSION_TYPE"); + if (xdg_session_type == "x11") { + string[] args = {}; + unowned string[] _args = args; + Gtk.init (ref _args); + } + accent_color_manager = new AccentColorManager (); // initialize plugins and add default components if no plugin overrides them