Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.4.0
-
None
-
Windows 7 64bit, Qt 5.4
-
52f5e50f11a3ba82e32dc2efc656e4021a3fa4f5 (qtbase/5.5, 25.2.2015)
Description
I have a 2 monitor setup, a laptop with a screen res of 1366x768 on the left, and a main external monitor with a res of 1680x1050 on the right.
In windows, the right monitor is setup as my main display.
On app start, QDesktopWidget::availableGeometry(-1) reports the correct size, if I then unplug the main monitor, availableGeometry(-1) correctly reports the correct size of the laptop screen.
If I then plug the external monitor back into the laptop, availableGeometry(-1) provides incorrect values.
Here is a chunk of log from the attached sample program which simple logs on signals from QDesktopWidget:
<< initial load (main window is external monitor) Initial availableGeometry QRect(0,0 1680x1010) << unplugging (main window is laptop) screenCountChanged availableGeometry QRect(-1366,382 1366x768) resized availableGeometry QRect(-1366,382 1366x768) resized availableGeometry QRect(0,0 1366x768) workAreaResized availableGeometry QRect(0,0 1366x768) workAreaResized availableGeometry QRect(0,0 1366x728) << plugging back in (main window is external monitor) screenCountChanged availableGeometry QRect(0,0 1366x728) resized availableGeometry QRect(-1366,382 1366x768) workAreaResized availableGeometry QRect(-1366,382 1366x768) workAreaResized availableGeometry QRect(-1366,382 1366x768)
I would expect, after plugging the external monitor back in that availableGeometry(-1) returns QRect(0,0 1680x1010)
I see the same (incorrect) behavior when physically removing the laptop from a dock and re-attaching it.
Attachments
Issue Links
- relates to
-
QTBUG-42985 Qt GUI application disappear or crash when no screens are available
- Closed
-
QTBUG-38404 XCB: QGuiApplication::primaryScreen doesn't change according to the primary screen
- Closed
-
QTBUG-33048 QDesktopWidget::primaryScreen() is always 0 and QGuiApplication::screens() always returns the primary one as first
- Closed
- resulted in
-
QTBUG-76162 When using separate dual displays (no Xinerama), menus will popup on display 0 even if the parent is on display 1
- Closed
For Gerrit Dashboard: QTBUG-44213 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
105285,5 | Improve handling of screens in QWidgets. | 5.4 | qt/qtbase | Status: MERGED | +2 | 0 |
105370,2 | Streamline code in QDesktopWidget. | 5.4 | qt/qtbase | Status: MERGED | +2 | 0 |