summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 2875463e62..d4effde52d 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1616,6 +1616,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)
{
@@ -1627,15 +1637,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);