-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.4.0 Beta
-
None
The xcb qpa does not fire off a QExposeEvent when the platform window is hidden. This is important for Qt3D as we need to use the QExposeEvent's to be able to know when to render to the window from another thread.
Since the platform window is not protected in any way it is possible for it to be pulled out from under us when rendering on a different thread which can lead to a crash in QOpenGLContext::swapBuffers() and QOpenGLContext::makeCurrent().
By responding to the QExposeEvents in a synchronous manner, we can safely keep rendering when the window is exposed and safely shutdown rendering when the window is hidden. This is especially needed when the window is hidden during QWindow::destroy() which may be called as a result of closing the window or the window being attached to a different screen.
It seems that the windows QPA, plugin fires off a QExposeEvent with an empty QRegion during QPlatformWindow::setVisible(false) but the xcb plugin does not. This makes it impossible to react accordingly.
I have a patch I'm testing and will push to gerrit shortly.
For Gerrit Dashboard: QTBUG-42476 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
99175,4 | Send QExposeEvent with null region before destroying platform window | 5.4 | qt/qtbase | Status: ABANDONED | -2 | 0 |
99911,6 | Send events when platform surfaces are created/about to be destroyed | dev | qt/qtbase | Status: MERGED | +2 | 0 |
100019,3 | Add debug output for QPlatformSurfaceEvent. | dev | qt/qtbase | Status: MERGED | +2 | 0 |