Skip to content

Commit

Permalink
Don't start shuffler daemon if not running on X11 or if we have no di…
Browse files Browse the repository at this point in the history
…splay - closes #446
  • Loading branch information
fossfreedom committed Mar 12, 2023
1 parent 2ccd872 commit 1abb5ed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions budgie-window-shuffler/src/windowshufflerdaemon.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1abb5ed

Please sign in to comment.