diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index cf13de427ec..9c6cb53365a 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.