ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.16k stars 59 forks source link

[Bug] Layer Shells namespace not set #204

Closed System64fumo closed 1 year ago

System64fumo commented 1 year ago

Is your feature request related to a problem? Please describe. Sort of, not exactly a functionality problem but a styling problem

Describe the solution you'd like The ability to disable the background dimmer (The overlay spanning every screen that also dims the screen according to your css style)

Describe alternatives you've considered Disabling blur effect for this layer, however since it uses the same generic name (gtk-layer-shell) as another program that i use (gtklock) i would like to keep the blur on a different layer shell for the notification center would help in this situation.

Additional context Using the blurls feature in hyprland (Blur layer shell) a blur can be applied to a layer of your choosing. However since swaync has a background dimmer feature which takes up the whole screen, the whole screen gets blurred as it's a part of the layer. The solution? disable the dim background feature (No hiding it with css does not work, the layer must be the size of the notification center only for this to work)

Screenshots: image image

ErikReider commented 1 year ago

The problem with this though is that the background window is also used to close the control center by clicking on it.

Setting the gtk-layer-shell namespace to something like "swaync-control-center" should work. The default is as you stated, "gtk-layer-shell"

ErikReider commented 1 year ago

Try compiling and using it with this patch:

diff --git a/src/controlCenter/controlCenter.vala b/src/controlCenter/controlCenter.vala
index 307c94f..e3a9d7c 100644
--- a/src/controlCenter/controlCenter.vala
+++ b/src/controlCenter/controlCenter.vala
@@ -37,6 +37,7 @@ namespace SwayNotificationCenter {
                 Process.exit (1);
             }
             GtkLayerShell.init_for_window (this);
+            GtkLayerShell.set_namespace (this, "swaync-control-center");
             GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.TOP, true);
             GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.LEFT, true);
             GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.RIGHT, true);
diff --git a/src/notificationWindow/notificationWindow.vala b/src/notificationWindow/notificationWindow.vala
index 2ac981d..300a441 100644
--- a/src/notificationWindow/notificationWindow.vala
+++ b/src/notificationWindow/notificationWindow.vala
@@ -45,6 +45,7 @@ namespace SwayNotificationCenter {
                 Process.exit (1);
             }
             GtkLayerShell.init_for_window (this);
+            GtkLayerShell.set_namespace (this, "swaync-notification-window");
             GtkLayerShell.set_layer (this, GtkLayerShell.Layer.OVERLAY);
             this.set_anchor ();
System64fumo commented 1 year ago

Yup that seemed to work As for the background window it's not necessary to have the click anywhere to close feature

ErikReider commented 1 year ago

As for the background window it's not necessary to have the click anywhere to close feature

Could you elaborate?

System64fumo commented 1 year ago

if you have a global bind to toggle the notification center visibility the necessity for a "Click anywhere to close" feature kind of becomes unnecessary imo Sure it's a nice to have But there can be cases where you don't want to close the notification center or have it interact such as quickly checking your notifications mid game A setting to have a fullscreen or windowed notification center in the config would be nice

ErikReider commented 1 year ago

But there can be cases where you don't want to close the notification center or have it interact such as quickly checking your notifications mid game

The keyboard/mouse is still gonna be inhibited whilst the control center is open. Without it, keyboard shortcuts wouldn't work

System64fumo commented 1 year ago

Turns out that secondary monitors don't get the swaync control center layer name Should have tested that earlier

ErikReider commented 1 year ago

Turns out that secondary monitors don't get the swaync control center layer name

Should be fixed now 7e21a29

leon-erd commented 5 months ago

You can achieve only blurring the control center and not the rest of the screen by putting layerrule = ignorezero, swaync-control-center in your hyprland.conf :)

OBLIXi-ON commented 5 months ago

Thanks mate! That's exactly what I was looking for.