Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
itshog opened this issue Aug 8, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@itshog
Copy link
Sponsor

itshog commented Aug 8, 2024

System Information

  • niri version: niri 0.1.7 (unknown commit) (the bug appears both in the version from Arch repo and when building from source with cargo build --release)
  • Distro: Arch Linux
  • GPU: Intel Corporation UHD Graphics 620
  • CPU: Intel(R) Core(TM) i5-8350U

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

  • bemenu, river
    bemenu-river

  • tofi, river
    tofi-river

  • bemenu, niri
    bemenu-niri

  • tofi, niri
    tofi-niri

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!

@itshog itshog added the bug Something isn't working label Aug 8, 2024
@YaLTeR
Copy link
Owner

YaLTeR commented Aug 8, 2024

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
Copy link
Sponsor Author

itshog commented Aug 8, 2024

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
Copy link
Owner

YaLTeR commented Aug 8, 2024

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
Copy link
Sponsor Author

itshog commented Aug 8, 2024

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
Copy link
Owner

YaLTeR commented Aug 8, 2024

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
Copy link
Sponsor Author

itshog commented Aug 8, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants