Windows QPA: Pass ExcludeUserInputEvents to QWSI::flushWindowSystemEvents()
User Input events flushed out by those calls have been observed to cause crashes. Task-number: QTBUG-39842 Change-Id: I950b80f2863def5b28e9fe46ef2b73aa6db2592f Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
29c6e39086
commit
d12a284bbb
@ -1480,7 +1480,7 @@ void QWindowsWindow::handleGeometryChange()
|
|||||||
QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen());
|
QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen());
|
||||||
}
|
}
|
||||||
if (testFlag(SynchronousGeometryChangeEvent))
|
if (testFlag(SynchronousGeometryChangeEvent))
|
||||||
QWindowSystemInterface::flushWindowSystemEvents();
|
QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
|
|
||||||
qCDebug(lcQpaEvents) << __FUNCTION__ << this << window() << m_data.geometry;
|
qCDebug(lcQpaEvents) << __FUNCTION__ << this << window() << m_data.geometry;
|
||||||
}
|
}
|
||||||
@ -1580,7 +1580,7 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
|
|||||||
// Our tests depend on it.
|
// Our tests depend on it.
|
||||||
fireExpose(QRegion(qrectFromRECT(ps.rcPaint)), true);
|
fireExpose(QRegion(qrectFromRECT(ps.rcPaint)), true);
|
||||||
if (!QWindowsContext::instance()->asyncExpose())
|
if (!QWindowsContext::instance()->asyncExpose())
|
||||||
QWindowSystemInterface::flushWindowSystemEvents();
|
QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
|
|
||||||
EndPaint(hwnd, &ps);
|
EndPaint(hwnd, &ps);
|
||||||
return true;
|
return true;
|
||||||
@ -1644,7 +1644,7 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowState state)
|
|||||||
switch (state) {
|
switch (state) {
|
||||||
case Qt::WindowMinimized:
|
case Qt::WindowMinimized:
|
||||||
handleHidden();
|
handleHidden();
|
||||||
QWindowSystemInterface::flushWindowSystemEvents(); // Tell QQuickWindow to stop rendering now.
|
QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents); // Tell QQuickWindow to stop rendering now.
|
||||||
break;
|
break;
|
||||||
case Qt::WindowMaximized:
|
case Qt::WindowMaximized:
|
||||||
case Qt::WindowFullScreen:
|
case Qt::WindowFullScreen:
|
||||||
@ -1667,7 +1667,7 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowState state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (exposeEventsSent && !QWindowsContext::instance()->asyncExpose())
|
if (exposeEventsSent && !QWindowsContext::instance()->asyncExpose())
|
||||||
QWindowSystemInterface::flushWindowSystemEvents();
|
QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -1773,7 +1773,7 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
|
|||||||
if (!wasSync)
|
if (!wasSync)
|
||||||
clearFlag(SynchronousGeometryChangeEvent);
|
clearFlag(SynchronousGeometryChangeEvent);
|
||||||
QWindowSystemInterface::handleGeometryChange(window(), r);
|
QWindowSystemInterface::handleGeometryChange(window(), r);
|
||||||
QWindowSystemInterface::flushWindowSystemEvents();
|
QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
} else if (newState != Qt::WindowMinimized) {
|
} else if (newState != Qt::WindowMinimized) {
|
||||||
// Restore saved state.
|
// Restore saved state.
|
||||||
unsigned newStyle = m_savedStyle ? m_savedStyle : style();
|
unsigned newStyle = m_savedStyle ? m_savedStyle : style();
|
||||||
|
Loading…
Reference in New Issue
Block a user