Astal icon indicating copy to clipboard operation
Astal copied to clipboard

gtk4 window layer property not working

Open kawaiiepic opened this issue 9 months ago • 5 comments

Describe the bug Setting the property 'layer' on the window widget to anything changes nothing on GTK4. no matter what the bar shows up on the 'top' layer

To Reproduce Generate a new GTK4 project and add the following properties to the window exclusivity={Astal.Exclusivity.IGNORE} layer={Astal.Layer.BACKGROUND}

Expected behavior For the Window to be on the background layer

Additional context I'm running NixOS with Hyprland 0.48.0 (5ee35f914f921e5696030698e74fb5566a804768)

kawaiiepic avatar Apr 04 '25 16:04 kawaiiepic

hhmm what if the first property that you set/define is the layer prop. something like that

Image

zerachiel016 avatar Apr 07 '25 00:04 zerachiel016

Wow, that works! is that intended?

kawaiiepic avatar Apr 07 '25 18:04 kawaiiepic

This is certainly not intended the order of the properties should not matter. I could not reproduce this on river, so it might be a bug in hyprland.

run it with the WAYLAND_DEBUG=1 env var set for both cases, so we can compare the difference.

kotontrion avatar Apr 08 '25 16:04 kotontrion

Here's when I run with layer at the beginning: (this one works) begin.log

and here's when I run the bar with the layer property at the end: (does not work)

end.log

kawaiiepic avatar Apr 08 '25 16:04 kawaiiepic

from begin:

[3008241.984] {Default Queue}  -> zwlr_layer_shell_v1#43.get_layer_surface(new id zwlr_layer_surface_v1#116, wl_surface#111, wl_output#31, 0, "gtk4-layer-shell")
[3008241.988] {Default Queue}  -> zwlr_layer_surface_v1#116.set_keyboard_interactivity(0)
[3008241.990] {Default Queue}  -> zwlr_layer_surface_v1#116.set_exclusive_zone(0)
[3008241.991] {Default Queue}  -> zwlr_layer_surface_v1#116.set_anchor(0)
[3008241.993] {Default Queue}  -> zwlr_layer_surface_v1#116.set_margin(0, 0, 0, 0)
[3008241.997] {Default Queue}  -> zwlr_layer_surface_v1#116.set_size(530, 36)
[3008242.000]  -> wl_surface#111.commit()
[3008242.011] {Default Queue}  -> zwlr_layer_surface_v1#116.set_anchor(2)
[3008242.014] {Default Queue}  -> zwlr_layer_surface_v1#116.set_anchor(6)
[3008242.016] {Default Queue}  -> zwlr_layer_surface_v1#116.set_anchor(14)
[3008242.017] {Default Queue}  -> zwlr_layer_surface_v1#116.set_size(0, 36)

from end:

[3209131.768] {Default Queue}  -> zwlr_layer_shell_v1#43.get_layer_surface(new id zwlr_layer_surface_v1#116, wl_surface#111, wl_output#31, 2, "gtk4-layer-shell")
[3209131.772] {Default Queue}  -> zwlr_layer_surface_v1#116.set_keyboard_interactivity(0)
[3209131.774] {Default Queue}  -> zwlr_layer_surface_v1#116.set_exclusive_zone(0)
[3209131.776] {Default Queue}  -> zwlr_layer_surface_v1#116.set_anchor(0)
[3209131.778] {Default Queue}  -> zwlr_layer_surface_v1#116.set_margin(0, 0, 0, 0)
[3209131.781] {Default Queue}  -> zwlr_layer_surface_v1#116.set_size(516, 36)
[3209131.784]  -> wl_surface#111.commit()
[3209131.794] {Default Queue}  -> zwlr_layer_surface_v1#116.set_anchor(2)
[3209131.797] {Default Queue}  -> zwlr_layer_surface_v1#116.set_anchor(6)
[3209131.799] {Default Queue}  -> zwlr_layer_surface_v1#116.set_anchor(14)
[3209131.801] {Default Queue}  -> zwlr_layer_surface_v1#116.set_size(0, 36)
[3209131.833] {Default Queue}  -> zwlr_layer_surface_v1#116.set_layer(0)

So you can see that if the property is set at the beginning, the layer is set to 0 (background) at creation, while in the second case when the property is set at the end, the layer is initially 2 (top) and then set to 0 after. So the layer is definitely send to the compositor, therefore it's likely a bug in hyprland. Test if you experience the same behavior when using hyprland built from git, if so, open a bug report there.

kotontrion avatar Apr 08 '25 17:04 kotontrion