summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowscontext.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-01-15 18:02:38 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-01-19 17:47:56 +0100
commit23996a9e4007d12cf3eee8f80cebedaf2bcca2e1 (patch)
treec9d5f2b0dc243045e37497af22dba0c266273adb /src/plugins/platforms/windows/qwindowscontext.cpp
parent447ef9766afbb9cb9bbf1a4f193306fe6d680ab6 (diff)
Windows: make TranslucentBackground functional always
QOpenGLWidget and QQuickWidget was not functional when WA_TranslucentBackground was set. This is due to the static "isGL" type of checks that are not suitable since 5.3 due to RasterGLSurface windows which may or may not be OpenGL windows, depending on their content. To handle this, we have to do some check on every makeCurrent and perform the necessary calls (most importantly SetLayeredWindowAttributes). Task-number: QTBUG-43854 Change-Id: If19c79482ec4f0a8b795ee710d52ed7e08b52563 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowscontext.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 13a3d044a0..2dab4f699f 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -430,7 +430,7 @@ void QWindowsContext::setKeyGrabber(QWindow *w)
// Window class registering code (from qapplication_win.cpp)
-QString QWindowsContext::registerWindowClass(const QWindow *w, bool isGL)
+QString QWindowsContext::registerWindowClass(const QWindow *w)
{
Q_ASSERT(w);
const Qt::WindowFlags flags = w->flags();
@@ -438,7 +438,9 @@ QString QWindowsContext::registerWindowClass(const QWindow *w, bool isGL)
// Determine style and icon.
uint style = CS_DBLCLKS;
bool icon = true;
- if (isGL || (flags & Qt::MSWindowsOwnDC))
+ // The following will not set CS_OWNDC for any widget window, even if it contains a
+ // QOpenGLWidget or QQuickWidget later on. That cannot be detected at this stage.
+ if (w->surfaceType() == QSurface::OpenGLSurface || (flags & Qt::MSWindowsOwnDC))
style |= CS_OWNDC;
if (!(flags & Qt::NoDropShadowWindowHint) && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)
&& (type == Qt::Popup || w->property("_q_windowsDropShadow").toBool())) {
@@ -471,8 +473,6 @@ QString QWindowsContext::registerWindowClass(const QWindow *w, bool isGL)
default:
break;
}
- if (isGL)
- cname += QStringLiteral("GL");
if (style & CS_DROPSHADOW)
cname += QStringLiteral("DropShadow");
if (style & CS_SAVEBITS)