Fix setting cursor pos on high DPI
When the cursor is on the non-primary monitor, QCursor::setPos doesn't seem to be able to translate the point using the scale factor of the correct monitor. We can use the overload that accepts a QScreen arg to tell Qt which monitor should be used to hopefully fix it in most cases.
Related upstream reports:
- https://bugreports.qt.io/browse/QTBUG-99009
- https://bugreports.qt.io/browse/QTBUG-78320
- https://bugreports.qt.io/browse/QTBUG-55038
I have only tested it on one Windows setup with the following monitor arrangement:
Display Information
Number of screens: 2
Screen: 0
Name: \\.\DISPLAY1
Depth: 32
Scale: 1.5
Position: 0, 0
Resolution in pixels: 1707x960
Manufacturer:
Model:
Refresh Rate: 60
Screen: 1
Name: \\.\DISPLAY2
Depth: 32
Scale: 1
Position: -1920, 0
Resolution in pixels: 1920x1080
Manufacturer:
Model:
Refresh Rate: 60
Edited by Alvin Wong