YaLTeR / niri

A scrollable-tiling Wayland compositor.
https://matrix.to/#/#niri:matrix.org
GNU General Public License v3.0
3.85k stars 116 forks source link

Wrong positioning and sizing of some layer shell applications (bemenu, tofi) #575

Open itshog opened 3 months ago

itshog commented 3 months ago

System Information

Description

Some menu programs using layer-shell, like bemenu and tofi, are wrongly positioned on the screen: in particular, bemenu's --center flag and tofi's anchor = center option seem to be completely ignored (it should be noted that, in the case of tofi, manual positioning with margin-* appears to be working as expected). When it comes to the sizing, bemenu's -W flag is ignored, while tofi respects the size specified in the config file but it stretches its content in strange ways (see pictures). Both programs work fine when using one of the major wlroots compositors (I included screenshots taken in river for reference).

I apologize beforehand in case it turns out that the issue isn't on niri's end, as it may be a bug in those two programs or in the underlying smithay library (or maybe those programs weren't meant to be run outside of wlroots to begin with).

Similar issue that may be useful (?): bemenu issue

Pictures

Logs

All logs are collected by adding WAYLAND_DEBUG=1 before the command (let me know if there are other useful logs I should collect)

Anyway, thanks for the great project! The "scrolling" paradigm is quite different from the classic tiling that I'm used to, but it sure has a lot of potential!

YaLTeR commented 2 months ago

Hey, so I suspect this might be these clients relying on wlroots-specific quirks of implementing underspecified anchoring combinations. You could try on KWin which is another separate layer-shell impl to see if the bugs reproduce there.

We already had an issue like this before with fuzzel, turned out KWin had the same behavior as Smithay, so it got fixed in fuzzel.

itshog commented 2 months ago

Hey, so I suspect this might be these clients relying on wlroots-specific quirks of implementing underspecified anchoring combinations. You could try on KWin which is another separate layer-shell impl to see if the bugs reproduce there.

I just tried both bemenu and tofi in plasma 6, and the centering options still seem to be ignored by the compositor. The sizing on the other hand works as expected, as is the case under wlroots. So I'm guessing that the anchoring/centering of those programs relies on something wlroots specific, whereas the sizing issues might actually be on smithay or niri's end.

YaLTeR commented 2 months ago

I see, thanks for testing. Well, layer-shell sizing and positioning is fully implemented in Smithay. I expect you'll see the same behavior as in niri in cosmic-comp or anvil. That is to say, parts of this issue which are decidedly not client problems are probably better moved to the Smithay repository.

itshog commented 2 months ago

I expect you'll see the same behavior as in niri in cosmic-comp or anvil.

How can I test in anvil/smallvil? I managed to compile and run them, but I can't figure out how to start applications

YaLTeR commented 2 months ago

In anvil there's a hardcoded Super+Enter shortcut to spawn weston-terminal (you can hardcode this to something else). Alternatively, from a terminal elsewhere: env WAYLAND_DISPLAY=wayland-2 some-command.

itshog commented 2 months ago

In anvil there's a hardcoded Super+Enter shortcut to spawn weston-terminal

Sorry, I was using a virtual machine and Super+Enter kept getting "eaten" by my host compositor. Anyway, anvil seems to behave just like niri, with both bemenu and tofi being unable to properly position and size themselves.