gtk4 window layer property not working
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)
hhmm what if the first property that you set/define is the layer prop. something like that
Wow, that works! is that intended?
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.
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)
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.