Bug 457143 - Windows with an odd width appear blurry when using the "under mouse" placement policy
Summary: Windows with an odd width appear blurry when using the "under mouse" placemen...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (other bugs)
Version First Reported In: git master
Platform: Other Linux
: VHI normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2022-07-25 23:13 UTC by Noah Davis
Modified: 2022-09-14 19:40 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.26
Sentry Crash Report:


Attachments
testoddwidth.qml (589 bytes, text/x-qml)
2022-07-25 23:13 UTC, Noah Davis
Details
testoddwidth.qml screenshot before moving window (10.58 KB, image/png)
2022-07-25 23:15 UTC, Noah Davis
Details
testoddwidth.qml screenshot after moving window (9.13 KB, image/png)
2022-07-25 23:15 UTC, Noah Davis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Noah Davis 2022-07-25 23:13:18 UTC
Created attachment 150909 [details]
testoddwidth.qml

SUMMARY
When a window with an odd width is created, the entire window is blurry, including server side window decorations. It's almost like the window has a fractional position. I know that QWindows only use integers for x/y/width/height and I'm using a 1x scale factor, so that doesn't make any sense, but it's all I can think of.

Moving the window fixes the problem.

STEPS TO REPRODUCE
1. Run the attached testoddwidth.qml file with qmlscene.

OBSERVED RESULT
The window looks blurry and there are various 1 pixel wide graphical artifacts when hovering over titlebar buttons

EXPECTED RESULT
The window should not look blurry and have no graphical artifacts.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220719
KDE Plasma Version: 5.25.80
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5
Kernel Version: 5.18.6-1-default (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 4800H with Radeon Graphics
Memory: 30.8 GiB of RAM
Graphics Processor: AMD RENOIR
Manufacturer: Eluktronics
Product Name: THINN-15
Comment 1 Noah Davis 2022-07-25 23:15:24 UTC
Created attachment 150910 [details]
testoddwidth.qml screenshot before moving window
Comment 2 Noah Davis 2022-07-25 23:15:49 UTC
Created attachment 150911 [details]
testoddwidth.qml screenshot after moving window
Comment 3 David Edmundson 2022-07-26 09:28:32 UTC
It'll be the centre placement throwing it off.
We do have a catch-all patch landing soon which will fix it when rendering, but I should probably make sure all 1x scaling cases stays exactly spot-on OOTB.
Comment 4 Arjen Hiemstra 2022-09-13 10:39:48 UTC
I am so far unable to reproduce this. Which placement strategy are you using?
Comment 5 Noah Davis 2022-09-13 22:51:04 UTC
(In reply to Arjen Hiemstra from comment #4)
> I am so far unable to reproduce this. Which placement strategy are you using?

I know we already discussed this elsewhere, but just for posterity, "Under mouse"
Comment 6 Bug Janitor Service 2022-09-14 08:23:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2943
Comment 7 Vlad Zahorodnii 2022-09-14 09:18:19 UTC
Git commit 817d13d8c028288de732e32e3825e470149e0c3c by Vlad Zahorodnii, on behalf of Arjen Hiemstra.
Committed on 14/09/2022 at 09:00.
Pushed by vladz into branch 'master'.

Ensure move() calls in placement move in integer values

Otherwise we run the risk of placing windows at floating coodinates,
which leads to interpolated rendering which doesn't look nice.

M  +2    -2    src/placement.cpp

https://invent.kde.org/plasma/kwin/commit/817d13d8c028288de732e32e3825e470149e0c3c