summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowswindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 5987324ac1..7528bf4155 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -351,6 +351,8 @@ static inline bool windowIsAccelerated(const QWindow *w)
return qt_window_private(const_cast<QWindow *>(w))->compositing;
case QSurface::VulkanSurface:
return true;
+ case QSurface::Direct3DSurface:
+ return true;
default:
return false;
}
@@ -1365,14 +1367,12 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data)
const Qt::WindowType type = aWindow->type();
if (type == Qt::Desktop)
return; // No further handling for Qt::Desktop
-#ifndef QT_NO_OPENGL
- if (aWindow->surfaceType() == QWindow::OpenGLSurface) {
- if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL)
- setFlag(OpenGLSurface);
- else
- setFlag(OpenGL_ES2);
- }
-#endif // QT_NO_OPENGL
+ if (aWindow->surfaceType() == QWindow::Direct3DSurface)
+ setFlag(Direct3DSurface);
+#if QT_CONFIG(opengl)
+ if (aWindow->surfaceType() == QWindow::OpenGLSurface)
+ setFlag(OpenGLSurface);
+#endif
#if QT_CONFIG(vulkan)
if (aWindow->surfaceType() == QSurface::VulkanSurface)
setFlag(VulkanSurface);
@@ -1831,8 +1831,11 @@ void QWindowsWindow::handleHidden()
void QWindowsWindow::handleCompositionSettingsChanged()
{
const QWindow *w = window();
- if ((w->surfaceType() == QWindow::OpenGLSurface || w->surfaceType() == QWindow::VulkanSurface)
- && w->format().hasAlpha()) {
+ if ((w->surfaceType() == QWindow::OpenGLSurface
+ || w->surfaceType() == QWindow::VulkanSurface
+ || w->surfaceType() == QWindow::Direct3DSurface)
+ && w->format().hasAlpha())
+ {
applyBlurBehindWindow(handle());
}
}
@@ -2008,9 +2011,10 @@ void QWindowsWindow::handleGeometryChange()
return; // QGuiApplication will send resize when screen actually changes
}
QWindowSystemInterface::handleGeometryChange(window(), m_data.geometry);
- // QTBUG-32121: OpenGL/normal windows (with exception of ANGLE) do not receive
- // expose events when shrinking, synthesize.
- if (!testFlag(OpenGL_ES2) && isExposed()
+ // QTBUG-32121: OpenGL/normal windows (with exception of ANGLE
+ // which we no longer support in Qt 6) do not receive expose
+ // events when shrinking, synthesize.
+ if (isExposed()
&& m_data.geometry.size() != previousGeometry.size() // Exclude plain move
// One dimension grew -> Windows will send expose, no need to synthesize.
&& !(m_data.geometry.width() > previousGeometry.width() || m_data.geometry.height() > previousGeometry.height())) {
@@ -2139,7 +2143,9 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
// Observed painting problems with Aero style disabled (QTBUG-7865).
if (Q_UNLIKELY(!dwmIsCompositionEnabled())
- && ((testFlag(OpenGLSurface) && testFlag(OpenGLDoubleBuffered)) || testFlag(VulkanSurface)))
+ && ((testFlag(OpenGLSurface) && testFlag(OpenGLDoubleBuffered))
+ || testFlag(VulkanSurface)
+ || testFlag(Direct3DSurface)))
{
SelectClipRgn(ps.hdc, nullptr);
}
@@ -2523,7 +2529,7 @@ void QWindowsWindow::setOpacity(qreal level)
m_opacity = level;
if (m_data.hwnd)
setWindowOpacity(m_data.hwnd, m_data.flags,
- window()->format().hasAlpha(), testFlag(OpenGLSurface) || testFlag(VulkanSurface),
+ window()->format().hasAlpha(), testFlag(OpenGLSurface) || testFlag(VulkanSurface) || testFlag(Direct3DSurface),
level);
}
}