From ee7b47e3ac6982ceabba242d2dc357c82cdfe46c Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Fri, 11 Feb 2022 18:47:32 +0100 Subject: [PATCH] Added wayland check --- src/controlCenter/controlCenter.vala | 7 +++++++ src/notiWindow/notiWindow.vala | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/controlCenter/controlCenter.vala b/src/controlCenter/controlCenter.vala index b01c883..3b3ff0d 100644 --- a/src/controlCenter/controlCenter.vala +++ b/src/controlCenter/controlCenter.vala @@ -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 (); diff --git a/src/notiWindow/notiWindow.vala b/src/notiWindow/notiWindow.vala index eba03fe..6487d06 100644 --- a/src/notiWindow/notiWindow.vala +++ b/src/notiWindow/notiWindow.vala @@ -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 ();