Windows: Filter out events sent during DestroyWindow().
Task-number: QTBUG-26933 Change-Id: Ie7aaf9f0c9c12a33b059e796a3be161a2d60c64e Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
This commit is contained in:
parent
fe8eb057fa
commit
0de7440cc6
@ -776,6 +776,9 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (platformWindow) {
|
if (platformWindow) {
|
||||||
|
// Suppress events sent during DestroyWindow() for native children.
|
||||||
|
if (platformWindow->testFlag(QWindowsWindow::WithinDestroy))
|
||||||
|
return false;
|
||||||
if (QWindowsContext::verboseEvents > 1)
|
if (QWindowsContext::verboseEvents > 1)
|
||||||
qDebug().nospace() << "Event window: " << platformWindow->window();
|
qDebug().nospace() << "Event window: " << platformWindow->window();
|
||||||
} else {
|
} else {
|
||||||
|
@ -737,10 +737,10 @@ void QWindowsWindow::destroyWindow()
|
|||||||
if (QWindowsContext::verboseIntegration || QWindowsContext::verboseWindows)
|
if (QWindowsContext::verboseIntegration || QWindowsContext::verboseWindows)
|
||||||
qDebug() << __FUNCTION__ << this << window() << m_data.hwnd;
|
qDebug() << __FUNCTION__ << this << window() << m_data.hwnd;
|
||||||
if (m_data.hwnd) { // Stop event dispatching before Window is destroyed.
|
if (m_data.hwnd) { // Stop event dispatching before Window is destroyed.
|
||||||
|
setFlag(WithinDestroy);
|
||||||
if (hasMouseCapture())
|
if (hasMouseCapture())
|
||||||
setMouseGrabEnabled(false);
|
setMouseGrabEnabled(false);
|
||||||
unregisterDropSite();
|
unregisterDropSite();
|
||||||
QWindowsContext::instance()->removeWindow(m_data.hwnd);
|
|
||||||
#ifdef QT_OPENGL_ES_2
|
#ifdef QT_OPENGL_ES_2
|
||||||
if (m_eglSurface) {
|
if (m_eglSurface) {
|
||||||
if (QWindowsContext::verboseGL)
|
if (QWindowsContext::verboseGL)
|
||||||
@ -760,6 +760,7 @@ void QWindowsWindow::destroyWindow()
|
|||||||
#endif
|
#endif
|
||||||
if (m_data.hwnd != GetDesktopWindow())
|
if (m_data.hwnd != GetDesktopWindow())
|
||||||
DestroyWindow(m_data.hwnd);
|
DestroyWindow(m_data.hwnd);
|
||||||
|
QWindowsContext::instance()->removeWindow(m_data.hwnd);
|
||||||
m_data.hwnd = 0;
|
m_data.hwnd = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,8 @@ public:
|
|||||||
SizeGripOperation = 0x100,
|
SizeGripOperation = 0x100,
|
||||||
FrameStrutEventsEnabled = 0x200,
|
FrameStrutEventsEnabled = 0x200,
|
||||||
SynchronousGeometryChangeEvent = 0x400,
|
SynchronousGeometryChangeEvent = 0x400,
|
||||||
WithinSetStyle = 0x800
|
WithinSetStyle = 0x800,
|
||||||
|
WithinDestroy = 0x1000
|
||||||
};
|
};
|
||||||
|
|
||||||
struct WindowData
|
struct WindowData
|
||||||
|
Loading…
Reference in New Issue
Block a user