Added wayland check

This commit is contained in:
Erik Reider 2022-02-11 18:47:32 +01:00
parent f59a121478
commit ee7b47e3ac
2 changed files with 14 additions and 0 deletions

View File

@ -25,6 +25,13 @@ namespace SwayNotificationCenter {
public ControlCenter (CcDaemon cc_daemon) {
this.cc_daemon = cc_daemon;
if (!GtkLayerShell.is_supported ()) {
stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n");
stderr.printf ("Swaync only works on Wayland!\n");
stderr.printf ("If running waylans session, try running:\n");
stderr.printf ("\tGDK_BACKEND=wayland swaync\n");
Process.exit (1);
}
GtkLayerShell.init_for_window (this);
this.set_anchor ();

View File

@ -44,6 +44,13 @@ namespace SwayNotificationCenter {
public bool closed = false;
public NotificationWindow () {
if (!GtkLayerShell.is_supported ()) {
stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n");
stderr.printf ("Swaync only works on Wayland!\n");
stderr.printf ("If running waylans session, try running:\n");
stderr.printf ("\tGDK_BACKEND=wayland swaync\n");
Process.exit (1);
}
GtkLayerShell.init_for_window (this);
GtkLayerShell.set_layer (this, GtkLayerShell.Layer.OVERLAY);
this.set_anchor ();