Bug 449818

Summary: Cursor pointer precision shifted out of place with fractional scaling other than 100%
Product: [Plasma] kwin Reporter: ryu.ketsueki
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate, xaver.hugl
Priority: NOR    
Version First Reported In: 5.24.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.0
Sentry Crash Report:

Description ryu.ketsueki 2022-02-09 04:34:00 UTC
SUMMARY
This is a bit tricky to explain but since I am using the Wayland session now because of the factional scaling, I noticed that the cursors aren't as precise as if the scaling were set on 100%. I use the scaling on 75%. With this, it seems the actual place the cursor is pointing at, is a few pixels to the left of where it should be, making selections imprecise. That means selecting a few extra letters in text or a few extra pixels on Gimp or even start the brush a few pixels to the left of where was intended. This doesn't happen on X11. Only Wayland. I also don't know if this occours only in Xwayland apps or if it also affects native Wayland apps.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220206
KDE Plasma Version: 5.24.0
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.16.4-1-default (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i3-7020U CPU @ 2.30GHz
Memory: 11.5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 620
Comment 1 Vlad Zahorodnii 2022-02-09 07:31:39 UTC
QPainter doesn't allow scale factors < 1, maybe this bug is caused by that issue as well, at least it's a known source of problems with decorations :(. Is the hotspot at correct position with scale factors > 1?
Comment 2 ryu.ketsueki 2022-02-09 11:29:31 UTC
(In reply to Vlad Zahorodnii from comment #1)
> QPainter doesn't allow scale factors < 1, maybe this bug is caused by that
> issue as well, at least it's a known source of problems with decorations :(.
> Is the hotspot at correct position with scale factors > 1?

I swapped to 125% temporarily and it would seem that the same problem happens with bigger scale factors too. I used Blockbench to test that, which displays a brush separate from the cursor. Less than 100% sets the brush a bit to the left of the pointer while higher than 100% sets it to the right, which makes sense for a scaling factor bug.
Comment 3 Vlad Zahorodnii 2022-02-09 11:38:36 UTC
What cursor theme do you use? and you use tablet, right?
Comment 4 ryu.ketsueki 2022-02-11 18:55:07 UTC
(In reply to Vlad Zahorodnii from comment #3)
> What cursor theme do you use? and you use tablet, right?

I can borrow a tablet to help debug anything and I use a cursor theme called Fluent, which is based on Breeze but the same thing happens to the default breeze cursor.
Comment 5 Zamundaaa 2024-06-06 17:07:12 UTC
The cursor is using floating point values for its position in Plasma 6, so this shouldn't be an issue anymore