Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.12.6, 5.13.2, 5.14.0
-
None
Description
I had fixed this prior to 5.13 but the patch was never accepted:
https://codereview.qt-project.org/c/qt/qtbase/+/188493
The problem is that Qt is adding device-independent pixels to device-dependent ones when calculating the positions of anything outside the first screen and coming up with nonsense. This can be seen from these lines in qtdiag:
Geometry: 1920x1080+3200+0 (native: 3840x2160+3200+0) Available: 1920x1080+3200+0 Virtual geometry: 5120x1080+0+0 Available: 5120x1080+0+0
The number 5120 is 1920+3200, but 1920 is a scaled number and 3200 isn't. That means 5120 is a nonsensical result. The end result is that positioning of many things are off.
See the attachment for an example. Note the menu is flush to the right of the second screen, so it's not exactly where it should have been. The File menu (hidden below the ruler) thinks it's roughly at position +3200, so it tries to display the menu at that position. But the actual screen size is only 1920+1600 = 3520 scaled pixels wide.
In the VirtualBox main window is in straddling both screens. Note the position of the menu drop-down.
Another application affected is kmail. Interestingly, it appears only the main window is affected. See the screenshots 1 and 2 to see the menu. The main window is stable so long as I don't resize it. If I do, drawing errors accumulate (screenshot-kmail3.png). This all widgets on the main window's viewport (the message list and folder list do not update, but the scrollbars do).
This does not happen in most other applications, notably Qt Creator and the main window examples. I'll keep trying to find an example that shows these issues.
Attachments
Issue Links
- is duplicated by
-
QTBUG-84235 The UI of Anki, depending on Qt 5.14.2, broke
- Closed
- relates to
-
QTBUG-58329 HiDPI Scaling (QT_SCALE_FACTOR set to > 1) doesn't work properly on non-primary displays in multi-monitor setups
- Closed
-
QTBUG-84378 WebEngineView: expanded select element geometry incorrect with multi screen setup
- Closed
-
QTBUG-106596 Incorrect positioning of Popup elements (and its descendants) when using multiple monitors and Windows display scaling
- Reported