summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowswindow.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@qt.io>2017-05-10 10:11:17 +0200
committerFrederik Gladhorn <frederik.gladhorn@qt.io>2017-05-10 10:11:57 +0200
commit6881e1613af3e31ca3cd6b297e7756bb61d2f038 (patch)
tree5398aaf4536d6c3f93869cf671ee0dbc42072ae1 /src/plugins/platforms/windows/qwindowswindow.cpp
parent3ae34b7ead938dc716e2fad2fa686d6867466255 (diff)
parent7f80c96432270e0097883e11e632c14cba68da28 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 79ae4c004b..818bff2693 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1695,6 +1695,16 @@ static inline bool dwmIsCompositionEnabled()
return SUCCEEDED(DwmIsCompositionEnabled(&dWmCompositionEnabled)) && dWmCompositionEnabled == TRUE;
}
+static inline bool isSoftwareGl()
+{
+#if QT_CONFIG(dynamicgl)
+ return QOpenGLStaticContext::opengl32.moduleIsNotOpengl32()
+ && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL;
+#else
+ return false;
+#endif // dynamicgl
+}
+
bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
WPARAM, LPARAM)
{
@@ -1706,15 +1716,10 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
return false;
PAINTSTRUCT ps;
-#if QT_CONFIG(dynamicgl)
- // QTBUG-58178: GL software rendering needs InvalidateRect() to suppress
- // artifacts while resizing.
- if (testFlag(OpenGLSurface)
- && QOpenGLStaticContext::opengl32.moduleIsNotOpengl32()
- && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
+ // GL software rendering (QTBUG-58178) and Windows 7/Aero off with some AMD cards
+ // (QTBUG-60527) need InvalidateRect() to suppress artifacts while resizing.
+ if (testFlag(OpenGLSurface) && (isSoftwareGl() || !dwmIsCompositionEnabled()))
InvalidateRect(hwnd, 0, false);
- }
-#endif // dynamicgl
BeginPaint(hwnd, &ps);