summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 3a6e6840fd..e58058010d 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1569,6 +1569,12 @@ void QWindowsWindow::releaseDC()
}
}
+static inline bool dwmIsCompositionEnabled()
+{
+ BOOL dWmCompositionEnabled = FALSE;
+ return SUCCEEDED(DwmIsCompositionEnabled(&dWmCompositionEnabled)) && dWmCompositionEnabled == TRUE;
+}
+
bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
WPARAM, LPARAM)
{
@@ -1582,8 +1588,7 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
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))
+ if (Q_UNLIKELY(testFlag(OpenGLSurface) && testFlag(OpenGLDoubleBuffered) && !dwmIsCompositionEnabled()))
SelectClipRgn(ps.hdc, NULL);
// If the a window is obscured by another window (such as a child window)