From 1abb5edf8f4c5adc84e83ee80737bf25fa0a7828 Mon Sep 17 00:00:00 2001 From: David Mohammed Date: Sun, 12 Mar 2023 21:18:47 +0000 Subject: [PATCH] Don't start shuffler daemon if not running on X11 or if we have no display - closes #446 --- budgie-window-shuffler/src/windowshufflerdaemon.vala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/budgie-window-shuffler/src/windowshufflerdaemon.vala b/budgie-window-shuffler/src/windowshufflerdaemon.vala index c394a421..30e92f49 100644 --- a/budgie-window-shuffler/src/windowshufflerdaemon.vala +++ b/budgie-window-shuffler/src/windowshufflerdaemon.vala @@ -1067,6 +1067,13 @@ namespace ShufflerEssentialInfo { public static int main (string[] args) { Gtk.init(ref args); + + /* exit gracefully if we are not running on X11 or have no display */ + var wnck_scr = Wnck.Screen.get_default(); + if (wnck_scr == null) return 0; // usually if not run on X11 + var gdk_scr = Gdk.Screen.get_default(); + if (gdk_scr == null) return 0; // usually if there is no display + // modifier keys gdkdisplay = Gdk.Display.get_default(); Gdk.Keymap keymap = Gdk.Keymap.get_for_display(gdkdisplay);