eww
eww copied to clipboard
[BUG] Exclusive not taking effect
Describe the bug
I have been trying to debug this for a couple of hours but at a bit of a loss.
From what i can gather exclusive is meant to make the window take up space on the screen and not float above it.
eww is setting the window as exclusive at least in the code(I break pointed on it) but the window manager is not respecting it.
The bar i am creating is floating over windows.
Here is my configuration for the bar
(defwindow bar :monitor 0 :exclusive true :focusable false :stacking "fg" :geometry (geometry :x "0%" :y "0%" :width "20px" :height "100%" :anchor "left top") (river-bar))
I fully believe i could just be misunderstanding how to make this work in wayland but from reading the documentation this seems to be the correct way.
I have tried the bar out in both river and sway both have the same issue.
Reproducing the issue
set exclusive to true in defwindow
Expected behaviour
The tiling window manager respects the exclusive space and doesn't allow it to overlap with windows.
Additional context
Image of window over lapping with bar:
Full configuration files used:
eww.scss.txt
eww.yuck.txt
@snakedye could you take a look at this? On the first look this seems as though it should indeed work - you're the wayland guy ^^
There's a misunderstanding of exclusive. The compositor if windows are tiled will for the most part shift the position of tiled windows. It doesn't mean the region of the widget is completely forbidden. Change the stacking to bottom
I updated it to look like this.
(defwindow bar :monitor 0 :exclusive true :focusable false :stacking "bottom" :geometry (geometry :x "0%" :y "0%" :width "20px" :height "100%" :anchor "left top") (river-bar))
Still getting the issue as you can see in the image below.
@snakedye is there any chance you can provide and example window that will reserve the space.
(defwindow barleft
:monitor 1
:geometry (geometry :height "38px" :width "100%" :anchor "bottom center")
:stacking "bt"
:exclusive "true"
(bar :tags {ristate.tags[1]}
:views {ristate.viewstag[1]})
)
Aright after using your example as a test. I played about with the configuration. It seems to be if you set the bar on the left or right anything other than center it will not reserve the space for the window. This seems like a bug.
Works as expected :geometry (geometry :height "20%" :width "20px" :anchor "left center") :geometry (geometry :height "20%" :width "20px" :anchor "right center")
Broken: :geometry (geometry :height "20%" :width "20px" :anchor "left top") :geometry (geometry :height "20%" :width "20px" :anchor "left bottom") :geometry (geometry :height "20%" :width "20px" :anchor "right top") :geometry (geometry :height "20%" :width "20px" :anchor "right bottom")
Try top left and top right.
Yeah it seems to be the same issue for top and bottom as well. center is the only option that will reserve space.
I will test this when I have time.
But did you try "top left" and "top right" as anchors? I revisited the code and the format seems to be "vertical horizontal".
Yes top left and top right, as well as bottom left and bottom right had the same issue where its not respected. I'm going to do some more testing later on today. i will tell you if i find out anything interesting.
Any updates on this issue? Did you manage to figure out what is going on?
I can reproduce this on eww and my own layer shell clients on river. Need to dig to know if it's normal behavior as in specified by the protocol.
@EuanFH Ok so after some further research and discussion:
this should work if you only had one window (i.e. you removed the clock window, and just showed the top left anchored bar.) That's obviously not the fix: If you want both, I'd recommend just going with making it one height 100% bar, and using something like centerbox
to set the middle part as empty. That way you can avoid the weird case of having multiple exclusive
windows attempt to be in the same place.
This might just work in other compositors, as far as it got explained to me river here simply chooses to not reserve any space because you have multiple clients be exclusive and anchored to the left
Confirming that this issue exists in Sway and Hyprland as well. It's not just a river issue.
Is this then just a general issue with layershell? As in, is this something eww could avoid? How does sway handle this with other bars, for example?
zwlr_layer_surface_v1::set_exclusive_zone "A positive value is only meaningful if the surface is anchored to one edge or an edge and both perpendicular edges. If the surface is not anchored, anchored to only two perpendicular edges (a corner), anchored to only two parallel edges or anchored to all edges, a positive value will be treated the same as zero."
If I'm reading this right it seems to be that any configurations that aren't center would be invalid and be considered non exclusive. Since i am assuming center is anchoring to the left and right or to top and bottom which would allow for exclusive to work.
Any update on this?
Center is when there's no anchor. Exclusive also will not work if there's more than one anchor.
Basically this is not a bug. The protocol is just built that way.
I had this same issue and ended up being able to fix my bar using :windowtype "dock"
.
According to the docs, this property is only supposed to do something on X11. However, on Hyprland no space is being reserved for my bar until I set it.
I had this same issue and ended up being able to fix my bar using
:windowtype "dock"
. According to the docs, this property is only supposed to do something on X11. However, on Hyprland no space is being reserved for my bar until I set it.
Seems unlikely, given that the code only ever references WindowType::Dock in exactly one place, which is x11 specific ^^ I assume you also changed something else there?
Alternatively, you might be running eww using xwayland or something, lol
Anyways, given that this seems to be figured out (as per wayland-man snakedye <3), I'll close this issue for now!
Seems unlikely, given that the code only ever references WindowType::Dock in exactly one place, which is x11 specific ^^ I assume you also changed something else there?
Alternatively, you might be running eww using xwayland or something, lol
That's really weird indeed. The thing is, I've actually double-checked this, with changing just the one property. Additionally, I've checked that it is not running on xwayland. I'm using eww-wayland-git, and xwininfo doesn't detect the window.
Moreover, when I run it on an X11 Plasma session, it is detected by xwininfo
and xlsclients
(it is not on Plasma Wayland or Hyprland), but the bar appears in the center of the screen, presumably because I do not have any other X11 properties set:
(defwindow bar
:monitor 0
:exclusive true
:geometry (geometry
:height "1080px"
:x "-4px" :y "0px"
:width "52px"
:anchor "left center"
)
:stacking "fg"
:windowtype "dock"
(bar))
Maybe I should open a new issue for this, but I'm just playing around with eww for the first time, so there's too large a change I'm just doing something weird.
I just encountered this same issue. Using wayland version off eww. only when the bar is smaller ie 80% in my case and not centered but top left for example. it stopped working.
Can we get an error for this? i.e. for using :exclusive true
without any of the valid anchors. Because while it seems to be the "expected" behavior of the protocol, it takes quite a while to figure out the solution.