From 6086c81e4d999d88ce4d412a20d250a219ab3c2c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 18 May 2016 11:07:04 +0200 Subject: [PATCH] Windows QPA: Improve workaround for non-Areo theme GL rendering. Reportedly, clearing the clip region is sufficient to fix the issue. InvalidateRect() should be avoided when handling WM_PAINT as it may cause events. Task-number: QTBUG-7865 Change-Id: Id9a7c280fcc2c8242bb34c34e73e53c3146e7a6e Reviewed-by: Andy Shaw Reviewed-by: Oliver Wolff Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowswindow.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index cf13de427e..9c6cb53365 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1568,12 +1568,13 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message, return false; PAINTSTRUCT ps; - // Observed painting problems with Aero style disabled (QTBUG-7865). - if (testFlag(OpenGLSurface) && testFlag(OpenGLDoubleBuffered)) - InvalidateRect(hwnd, 0, false); - BeginPaint(hwnd, &ps); + // Observed painting problems with Aero style disabled (QTBUG-7865). + // 5.8: Consider making it dependent on !DwmIsCompositionEnabled(). + if (testFlag(OpenGLSurface) && testFlag(OpenGLDoubleBuffered)) + SelectClipRgn(ps.hdc, NULL); + // If the a window is obscured by another window (such as a child window) // we still need to send isExposed=true, for compatibility. // Our tests depend on it.