Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.12.5
-
None
-
Qt 5.12.5 (qtbase commit 1d8c9978fa)
Windows 10
-
-
174061f9f32ac76c6b8a6d155d772e37708d8cfc (qt/qtbase/5.12)
Description
We are using a self-built version of Qt built in mid July from the tip of the 5.12 branch (qtbase commit 1d8c9978fa). Our version of qtbase is unpached relative to the official version. Mapping between local and global coordinates fails when a window is on the non-primary display on a system with two identical High DPI displays. If I build the attached test application with the official 5.12.4, I don't see this behavior, so it seems that it must have been recently introduced.
I haven't verified which commit caused this problem, but I suspect it's https://code.qt.io/cgit/qt/qtbase.git/commit/src/gui/kernel/qhighdpiscaling.cpp?id=b6ded193ee64ffe67df6d22e7a23aa1ea9e02ec7 based on the file that was changed and the time frame. That commit was related to QTBUG-73231.
My configuration is two identical 24" high DPI displays running at 200% scaling (configured in the OS) on Windows 10. The left screen is the primary display.
If I build the attached project with Qt 5.12.4, I get the same correct behavior when I have the main window on either display. If I click within the window, the coordinates in the top group box are the same, and those in the bottom group box are the same (see SecondaryDisplay_Qt5_12_4.PNG). Also, the combo box works correctly in that if I click on it, I can hover over other items and those are displayed as highlighted. Clicking on an item selects it.
If I build with my version of qt 5.12.5 described above, I still get the expected behavior when the main window is on the primary display. However when I move the main window to the secondary display and click within the window, the position returned by QWidget::mapFromGlobal doesn't agree with the other two coordinates in the upper group box, and the coordinates in the lower group box are different. Also, if I pop up the combo box and move the mouse over the different items, the highlighted item does not change. If I click on one of the items, the click is ignored (instead of being treated as a selection of a different item). This can be seen in SecondaryDisplay_Qt5_12_5.PNG. I have circled the values that do not agree. The red arrow is approximately where the mouse cursor was when I took the screen shot.
In my case, only the x values of the coordinates disagree. I assume that this is because the monitors are the same height and are arranged next to one another horizontally. If the monitors were stacked on one another, I would expect the y coordinates to disagree instead of the x coordinates.
I have attached the screen information from qtdiag. It's the same for both the official 5.12.4 build and my 5.12.5 build.
Attachments
Issue Links
- resulted from
-
QTBUG-73231 When a menubar spans across displays using different DPIs then opening menus on either display can show the menu in the wrong place
- In Progress