-
Notifications
You must be signed in to change notification settings - Fork 1.2k
container, transaction: align to fractional grid #8715
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
base: master
Are you sure you want to change the base?
Conversation
9117b36
to
ca259fb
Compare
ab9d5f1
to
ddc7fe1
Compare
Rebased to latest master to resolve conflicts (and include the above fix) |
ddc7fe1
to
af56e04
Compare
7aa23dc
to
99a9e85
Compare
7d7f474
to
0aab7ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0aab7ef
to
1fe246f
Compare
Yes this is something that will be fixed with another wlroots PR that will replace I believe for now we can proceed with the rest |
1fe246f
to
00b0f7e
Compare
Latest wlroots (from the related PR) solves these small precision losses, as it replaces usage of |
089beb5
to
f3fec51
Compare
I have been testing this for two weeks with no regressions or bugs that I know of |
f3fec51
to
e0658a6
Compare
e0658a6
to
e18cd95
Compare
I think this is an issue that also happens on latest stable (1.11) version (I just tried it). How exactly did you reproduce this? With the same scaling factor as in the screenshot (1.14), spawning foot or alacritty instances and making them floating do not immediately lead to these small gaps around their containers for me, only after trying to slightly resize them I can see them |
Hmm, after a few more tests this issue seems to be fairly prominent with foot. With alacritty this does not seem to be the case in latest stable, but in this PR if you carefully resize I can reproduce the slight gap in floating windows. Will look into this a bit more to fix it. P.S. using very odd scale values like 1.14 or 2.68 seems to help reproduce this, with mine that was 1.75 was not easily reproducible |
e18cd95
to
d659b21
Compare
I found the problem! It was a misalignment for the right and bottom border rects, due to content width and height not being aligned to pixel grid. @vyivel, could you check again please? |
Like in wlroots: I’ve been using this branch for two weeks now without noticing any issues. Thank you very much @agorgl |
First of all, thank you for this effort, it seems the right way to fix this issue. I have a question, though. You make an effort to align the content to pixel boundaries when taking into account buffers will be scaled by the output scale. For this, you modify the widths and heights of containers to be integer values when corrected by the output scale, which seems the right way. That way, the buffers will occupy an integer number of pixels in the output. The problem I see, and maybe I am not understanding something, is From my (maybe wrong) point of view, I think you may need some magic there, so the client receives a buffer size request that is of a size that turns into an integer size in the output at the native scale, or simply assume the size of the buffer will be integer (whatever) and try to align the origins. |
The problem lies in the wayland protocol in this case. The configure event sends width and height as (logical) integers, so some careful planning is required in both sides (sway <-> wlroots). We send some integer values from sway that when they reach wlroots and it scales and rounds them, they will end up as the original values sent in the configure event. It is like sway foresees the kind of rounding wlroots will do, and compensates for that in the width/height values of the configure event. |
As noted in #8131, after some testing this, I've found various fractional scales which still produce blurry rendering. Also, no differences from current git master in this regard. |
Please provide the exact client used, and try to reproduce this with |
Thanks! All the details are noted here: #8131 (comment). Sorry I'd linked to the general bug, not my specific comment. Didn't want to copy that whole thing into the MR thread. Cannot reproduce with |
I don't see a response to your requested feedback, but I can reproduce the small gaps in
Confirmed this also occurs on current git master, so nothing to do with this PR. Still using this patch + wlroots!5071 + wlroots!5159 for good measure, as I build against Wayland 1.24 and that fixes its respective issue. No regressions noted. |
d659b21
to
2ffea35
Compare
Signed-off-by: Loukas Agorgianitis <[email protected]>
Signed-off-by: Loukas Agorgianitis <[email protected]>
Signed-off-by: Loukas Agorgianitis <[email protected]>
Signed-off-by: Loukas Agorgianitis <[email protected]>
Signed-off-by: Loukas Agorgianitis <[email protected]>
Signed-off-by: Loukas Agorgianitis <[email protected]>
2ffea35
to
85ccf58
Compare
Adapts to wlroots wlr_scene breaking changes introduced by PR https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5071
Implements proper alignment to fractional grid thus solving all of the blurrying problems and border size mismatches in sway.
Fixes: #8131, #8117 (and many more like these)
Supersedes: #8660