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

Fix anchoring in kwin and smithay #189

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

itshog
Copy link

@itshog itshog commented Aug 11, 2024

Should resolve #165; should also fix #170. Instead of setting all anchors for centering (or, for instance, setting both left and right anchor to achieve horizontal centering), we now only set the needed anchor.

See this fuzzel commit for more information.

Solves a bug regarding wrong anchoring which also caused the content of the tofi window to get stretched in strange ways in kwin and compositors using smithay. Instead of setting all anchors for centering (or, for instance, setting both left and right anchor to achieve horizontal centering), we now only set the needed anchor
@chriselrod
Copy link

This works for me on niri.

@philj56 philj56 added the bug Something isn't working label Dec 30, 2024
@philj56
Copy link
Owner

philj56 commented Dec 30, 2024

Hey, sorry for the slow response on this and thanks for the PR! Unfortunately this issue isn't quite so simple.

The reason opposing anchors were set to centre the window, rather than neither, was because this is required to get a full-width / height window on a compositor that:

  • Supports fractional scaling
  • Does not support the wp-fractional-scale-v1 protocol.
    In this scenario, it's impossible (I think) for the window to determine how big it needs to be, at least in the way tofi works.

With this patch set, setting --width=0 --anchor=center on sway gives me:

zwlr_layer_surface_v1#20: error 1: width 0 requested without setting left and right anchors

and no visible window.

Back when I was last updating tofi, wp-fractional-scale-v1 was not widely implemented, so I couldn't rely on it.
Nowadays however, it seems almost all compositors support it, so we can probably get rid of the legacy --width=0 behaviour. I think the correct thing to do is:

  • Make a release (soon!), with warnings that --width=0 and --height=0 are deprecated, and 100% is preferred.
  • In the release after that, remove --width=0 support and merge this.

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

Successfully merging this pull request may close these issues.

Window Positioning Issue on KDE Plasma 6 Tofi not respecting anchor and resolution/scaling on Niri
3 participants