Details
-
Bug
-
Status: Reported
-
P3: Somewhat important
-
Resolution: Unresolved
-
5.12.10, 5.14.2, 5.15.2
-
None
-
None
Description
We use Qt inside Adobe Illustrator. Illustrator offers custom UI scaling on top of OS scaling. We use QT_SCALE_FACTOR to have the extra scaling also in our Qt UI.
When QT_SCALE_FACTOR is set (and > 1.0) the following issue occurs on macOS:
When a drop-down is close to the right or bottom edge of the screen, then clicking on the drop-down does nothing, instead of showing a pop-up with all the entries.
Namely, when QT_SCALE_FACTOR is 1.5, then it is the right resp. bottom 33% of the screen. If it is 2.0, then it is 50% on the right and 50% at the bottom.
The rootcause: QWindow uses the logical coordinates, whereas QPlatformWindow and QCocoaWindow use the screen or native coordinates. Therefore when passing coordinates between these 2 objects, they need to be converted to or from native,
Therefore, I believe the call window()->setGeometry(geometry()) in QCocoaWindow::initialize() is wrong. Instead, something like window()->setGeometry(QHighDpi::fromNativePixels(geometry(), window())) should be called.
Patches for Qt 5.12.10, 5.14.2, 5.15.2 are attached.