Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.14.1
-
None
-
Kubuntu 19.10, Qt 5.14.1 installed using MaintenanceTool.
Wacom Bamboo using the pen in absolute mode.
Description
When using my Wacom Bamboo tablet in absolute mode and a desktop in HiDPI mode, Qt calculates wrong cursor positions: they're offset by what looks to be ($scale - 1) / $scale * $windowPosition. So in other words, the calculated position is correct if the window is positioned in the upper left corner without a window frame, and then scales linearly if the window is moved away from that corner.
the $scale is set using QT_SCREEN_SCALE_FACTORS.
I've attached a screenshot of a test program I wrote to investigate this (shows bug: PosBug_Pen_Scaled.png; shows expected behaviour: PostBug_Mouse_Scaled.png), as well as that program itself.
Looking at the numbers, it's clear that QMouseEvent::globalPos() as well as QCursor :: pos() are correct, but everything window-relative is not.
When using the mouse, or a scale factor of 1, everything works fine. Also, I don't see this bug when compiling with Kubuntu's system-Qt (5.12.4), nor do I remember encountering this with older Qt versions.