Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.3
-
None
Description
When using a multi-monitor window setup, we encountered an issue with the QWindow::screenChanged signal. The issue occurs when there is a parent-child window hierarchy, where window A is positioned on a secondary monitor and has a linear parent-child relationship with windows B and C (A->B->C).
The specific problem arises when window B's parent is set to nullptr, and subsequently set back to A. In this situation, window C, which has registered for the QWindow::screenChanged signal, is expected to receive the signal with the screen set to the secondary monitor, as that is where window A is initially positioned. However, no signal is received by window C.
Steps to Reproduce
- Set up a multi-monitor window setup with at least two monitors.
- Create a linear parent-child window hierarchy, where window A is positioned on a secondary monitor, and window C is a child of window B, which is a child of window A (A->B->C).
- Ensure that window C has registered for the screenChanged signal.
- Set the parent of window B to nullptr.
- Set the parent of window B back to window A.
Expected Results
After step 5, window C should have received screenChanged signal with the screen set to the secondary screen, as that is where window A is initially positioned.
Actual Results
After step 5, no screenChanged signal is received by window C. However, C's screen() API would return it as the secondary screen as expected.
Attachments
qtbug-120928.zip is a sample test app that reproduces this issue.
Configuring the project and running the app should cause the application to assert with an error message.