From 9f894788dda8407c6221aaa1491cd54a5a2b4cb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 6 Jan 2021 14:04:27 +0100 Subject: [PATCH] Revert "Windows QPA: Call QWSI::flushWindowSystemEvents() from WM_PAINT for full update only" This reverts commit a81dfb32d6f9e7a407567511c20b59e537f6a063. Paint immediately on WM_PAINT in all cases in order to avoid flicker on resize. The cases mentioned in commit a81dfb should no longer apply: - QTBUG-38327: QGLWidget is not supported in Qt 6. - QTBUG-39842: Fixed by using ExcludeUserInputEvents. Fixes: QTBUG-89688 Change-Id: If82cf7703d6663982769048e86a7060223730ce7 Reviewed-by: Friedemann Kleint Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowswindow.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 7528bf4155..f872c49dc9 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -2129,8 +2129,7 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message, if (!window()->isVisible() && (GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_LAYERED) != 0) return false; // Ignore invalid update bounding rectangles - RECT updateRect; - if (!GetUpdateRect(m_data.hwnd, &updateRect, FALSE)) + if (!GetUpdateRect(m_data.hwnd, 0, FALSE)) return false; PAINTSTRUCT ps; @@ -2154,7 +2153,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 (qSizeOfRect(updateRect) == m_data.geometry.size() && !QWindowsContext::instance()->asyncExpose()) + if (!QWindowsContext::instance()->asyncExpose()) QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents); EndPaint(hwnd, &ps);