Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.3.1
-
Linux 3.1, X11, XCB backend, Qt 5.3, multi-head setup with dual monitor.
-
75e5ffe0f71bfccd6ae31d1b437dfea58bfb28a7
Description
When a multi-head setup is used, QWidget::winId() is broken. (I have a test case attached which can reproduce the bug).
QWidget/QWindow may re-create the underlying window and change WinId() at runtime. However, QEvent::WinIdChange is not always emitted and QWidget::winId() always return the old value. Then, I got error message from QBackStore stating that the window has no handle and the window disappeared.
Steps to reproduce the bug:
1. Run the test program and use "xwininfo" command to check its window ID.
2. Plug in an external monitor
3. Use xrandr to get a dual monitor setup with the external monitor attached to the right border of the primary monitor.
4. Move the window of the test program to the external monitor.
5. Use xrandr to turn off the external monitor.
6. My test program will move the window back to the primary monitor when the external monitor is turned off (it listens to QDesktopWindow::screenCountChanged() signal)
7. Use "xwininfo" command to inspect the window of the test program
8. You'll notice that the window ID is changed as shown by xwininfo. However, effectiveWindowId() still returns the old value.
If you repeat the steps for many times, the test program will crash with a broken QBackingStore and an invalid window handle.
This only happens in Qt5. I also tested Qt 4.8 and it does not have the bug.
Please fix the regression bug. Forgetting to update the internal winId can crash the program so this is very critical.
Thanks!
Attachments
Issue Links
- relates to
-
QTBUG-40791 Regression: QPlatformWindow, QWindow, and QWidget::winId() are out of sync.
- Closed
-
QTBUG-40768 QWindowContainer does not handle QEvent::WinIdChange of its parent
- Closed
-
QTBUG-40817 Crash when detaching primary monitor/leaving virtual desktop if there are native widgets in hierarchy
- Closed
-
QTBUG-40771 Add QEvent::WinIdAboutToBeChanged event to QWidget
- Reported
- replaces
-
QTBUG-41163 using KVM Switch: Segmentation fault (core dumped)
- Closed