When a window is shown and quickly hidden again we can get to
a state, on a asynchronous windowing system API, where the
isExposed=true event has been pushed to the event queue but
not yet processed at the time the user calls hide().
As hide() immediately sets isVisible() to false, we end up with
isExposed=true and isVisible=false which prevent the WM_Obscure
event to be sent to render loop which means the render thread
thought the window was still on screen when we reched the
shutdown in WM_TryRelease.
Changed WM_TryRelease handling to disregard window state when
the window is being deleted. This forces SG and GL cleanup
and stops the thread.
Task-number: QTBUG-35055
Change-Id: Ibac5aa27354d6450f30a61450214cb785ab855bf
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
case WM_TryRelease: {
QSG_RT_DEBUG("WM_TryRelease");
mutex.lock();
- if (!window) {
- WMTryReleaseEvent *wme = static_cast<WMTryReleaseEvent *>(e);
+ WMTryReleaseEvent *wme = static_cast<WMTryReleaseEvent *>(e);
+ if (!window || wme->inDestructor) {
QSG_RT_DEBUG(" - setting exit flag and invalidating GL");
invalidateOpenGL(wme->window, wme->inDestructor);
active = gl;