Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.3.1, 6.6.1
-
None
-
Windows 10
macOS 13
Description
When, for example, I have a 1500x1500 screen with 150% UI scaling factor connected to my Windows box, then QPlatformWindow::initialGeometry() fails to find the right screen in some cases.
With the 150% factor, the widget's coordinate space is 0..999 in my example, while the native coordinates are 0..1499.
The argument of QPlatformWindow::initialGeometry() is expected (and given) in native coordinates 0..1499, whereas QGuiApplication::screenAt() expects coordinates in the range 0..999.
Hence I believe either of the following changes should be applied:
- either QGuiApplication::screenAt(QHighDpi::fromNativePixels(initialGeometry.center(), w)) i.s.o. just QGuiApplication::screenAt(initialGeometry.center(), w)
- or the initialization of deviceIndependentRect moved upwards and then QGuiApplication::screenAt(deviceIndependentRect.center(), w) used