From 05aedf4e1d12701e4b48091e1451e88604957ed7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 28 Jun 2016 10:00:51 +0200 Subject: Windows QPA: Restrict expose workaround to non-Aero themes. The workaround may cause flicker, so only use it when necessary. Task-number: QTBUG-7865 Change-Id: I813aa0669727303bc947a85a8893a90f29d3ff24 Reviewed-by: Andy Shaw --- src/plugins/platforms/windows/qwindowswindow.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/plugins') 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) -- cgit v1.2.3