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 <andy.shaw@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Friedemann Kleint 2016-05-18 11:07:04 +02:00
parent e9628fbd39
commit 6086c81e4d

View File

@ -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.