summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2016-06-28 10:00:51 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2016-06-28 08:31:19 +0000
commit05aedf4e1d12701e4b48091e1451e88604957ed7 (patch)
treedbe84762cf7a3db16cc0d77a5c2d9e72fd5f7230 /src/plugins
parent29ac40d6cda0d6e13bb1e47bc4fd1cc282afcab3 (diff)
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 <andy.shaw@qt.io>
Diffstat (limited to 'src/plugins')
-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)