Bug 501329 - When width of surface multipled by fractional scaling value are certain values, fonts are blurry in kitty
Summary: When width of surface multipled by fractional scaling value are certain value...
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: 6.3.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-11 03:21 UTC by Kelvie Wong
Modified: 2025-03-12 21:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
patch I used on kwin to match the the sizes (1.56 KB, patch)
2025-03-11 03:24 UTC, Kelvie Wong
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kelvie Wong 2025-03-11 03:21:38 UTC
SUMMARY
I reported this to kitty, and the developer there said this is likely a compositor issue. I can help fix this if someone can point me to the right direction (I've contributed a bugfix to kwin a long time ago in the past!)

https://github.com/kovidgoyal/kitty/issues/8429

STEPS TO REPRODUCE
1. Set fractional scaling to 1.25x (e.g. using kscreen-doctor output.DP-1.scale."1.25" )
2. Resize the window so that the surface width, when multipled by the scaling factor, ends up .00, .50, or 0.75
3. notice the blurry fonts

This is all in the github bug above, with screenshots and logs. I also put some debug statements in kwin (I think I have the right spot), and as far as I can tell, kwin and kitty both agree on the pixel-perfect size of the buffer.

As a workaround, I've been setting the screen scale to 1.26 (which actually gets set as 1.2583333333333333), presumably so it's a lot less likely to run into whatever rounding error is causing this.

OBSERVED RESULT
Blurry fonts


EXPECTED RESULT

Not blurry fonts

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.2
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.13.5-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 5950X 16-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 4090

ADDITIONAL INFORMATION

See the bug in: https://github.com/kovidgoyal/kitty/issues/8429
Comment 1 Kelvie Wong 2025-03-11 03:24:15 UTC
Created attachment 179281 [details]
patch I used on kwin to match the the sizes

This is the patch I used to check the sizes, kitty uses the wayland xdg_toplevel::configure message and multiplies the fractional scaling value (rounding up at 0.5 according to the spec), and that value matches the buffer size here, but I'm not sure if this is the value that's off by one or more pixels.
Comment 2 Bug Janitor Service 2025-03-12 04:09:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7319
Comment 3 Kelvie Wong 2025-03-12 21:31:15 UTC
Turns out it was this the rounded corners plugin that causes this, weirdly: https://github.com/matinlotfali/KDE-Rounded-Corners/issues/149

I still think it is off by a pixel in certain (much rarer) cases though.