From a81dfb32d6f9e7a407567511c20b59e537f6a063 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 30 Jan 2017 10:05:58 +0100 Subject: Windows QPA: Call QWSI::flushWindowSystemEvents() from WM_PAINT for full update only It was introduced by 071914232189735ae6475d44d07f11f90b4729a1 (macOS QML fix) for apparently historical reasons and has been found to cause various problems: - Flicker when using QGLWidget in a QSplitter - (obscure) crashes due to flushing out input events in setVisible(). Task-number: QTBUG-38327 Task-number: QTBUG-39842 Change-Id: I18081da5f4645271774a51f1d6a88e778adbd6ac Reviewed-by: Gabriel de Dietrich Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 40229d00af..0028ad1bd0 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1622,7 +1622,8 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message, if (message == WM_ERASEBKGND) // Backing store - ignored. return true; // Ignore invalid update bounding rectangles - if (!GetUpdateRect(m_data.hwnd, 0, FALSE)) + RECT updateRect; + if (!GetUpdateRect(m_data.hwnd, &updateRect, FALSE)) return false; PAINTSTRUCT ps; @@ -1646,7 +1647,7 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message, // we still need to send isExposed=true, for compatibility. // Our tests depend on it. fireExpose(QRegion(qrectFromRECT(ps.rcPaint)), true); - if (!QWindowsContext::instance()->asyncExpose()) + if (qSizeOfRect(updateRect) == m_data.geometry.size() && !QWindowsContext::instance()->asyncExpose()) QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents); EndPaint(hwnd, &ps); -- cgit v1.2.3