selairi / yatbfw

Yes another task bar for Wayland
BSD 3-Clause "New" or "Revised" License
11 stars 3 forks source link

panel.cpp: anchor adjacent edges #10

Closed johanmalm closed 1 year ago

johanmalm commented 1 year ago

...in order to work with labwc and wlroots 0.16.0 scene-graph API.

The layer-shell protocol specifies that a positive exclusive-zone value is 'meaningful' if the surface is anchored to either:

  1. one edge
  2. one edge and both perpendicular edges.

For example, with position=top and exclusive=true, you should be able to set either anchor=TOP or anchor=TOP|LEFT|RIGHT. The wlroots 0.16.0 scene-graph API currently only supports the second case and it appears that many panels/bars use that approach (anchor to an edge and also both perpendicular edges) which is probably why this has not been discovered previously.

A Merge Request has been submitted to the wlroots project, but the release cycle is quite slow, so I wanted to offer this solution in order not to inconvenience users.

https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3884