diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-05-02 13:54:43 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-05-08 15:14:58 +0000 |
commit | b97a70361308b10431222a0e95f3befa15fdcc71 (patch) | |
tree | 23236e4eda56b203cbd170195a7b93fa394cc3f3 /src/plugins/platforms/windows/qwindowswindow.cpp | |
parent | b7da94ce5251d91acd60d4c82684f12c7d11affc (diff) |
Windows QPA: Call InvalidateRect() for GL windows when Aero is off
Some AMD cards have been reported to not update otherwise.
Task-number: QTBUG-60527
Change-Id: I84d57a57eb2b76fb31255ae42b79b96ab7b257c9
Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 21 |
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); |