summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-09-13 18:04:17 +0200
committerSergio Ahumada <sergio.ahumada@digia.com>2013-09-13 18:04:17 +0200
commitf7837e28b5f83d116fa43d0401b7188ce27fc346 (patch)
tree3de2560e4259f22224f334be17618386860decc7 /src/plugins/platforms/windows
parent8b0624182bd4998d32c23eded5dbe6dccfd26d5b (diff)
parent44a58de2aea6d2ac71efe7261a398effbf139f3f (diff)
Merge branch 'stable' into dev
Conflicts: src/concurrent/qtconcurrentmedian.h src/corelib/itemmodels/qabstractitemmodel.cpp Change-Id: Iac46a90bbb2958cef7670031a4b59c3becd8538a
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
index dfbbe3069c..26205eb146 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
@@ -88,8 +88,10 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion &region,
QWindowsWindow *rw = QWindowsWindow::baseWindowOf(window);
#ifndef Q_OS_WINCE
+ const bool hasAlpha = rw->format().hasAlpha();
const Qt::WindowFlags flags = window->flags();
- if ((flags & Qt::FramelessWindowHint) && QWindowsWindow::setWindowLayered(rw->handle(), flags, rw->format().hasAlpha(), rw->opacity())) {
+ if ((flags & Qt::FramelessWindowHint) && QWindowsWindow::setWindowLayered(rw->handle(), flags, hasAlpha, rw->opacity()) && hasAlpha) {
+ // Windows with alpha: Use blend function to update.
QRect r = window->frameGeometry();
QPoint frameOffset(window->frameMargins().left(), window->frameMargins().top());
QRect dirtyRect = br.translated(offset + frameOffset);
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index f3faccbc14..7077eaf4b0 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -314,7 +314,8 @@ static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qr
Q_UNUSED(level);
#else
if (QWindowsWindow::setWindowLayered(hwnd, flags, hasAlpha, level)) {
- if (flags & Qt::FramelessWindowHint) {
+ if (hasAlpha && (flags & Qt::FramelessWindowHint)) {
+ // Windows with alpha: Use blend function to update.
BLENDFUNCTION blend = {AC_SRC_OVER, 0, (BYTE)(255.0 * level), AC_SRC_ALPHA};
QWindowsContext::user32dll.updateLayeredWindow(hwnd, NULL, NULL, NULL, NULL, NULL, 0, &blend, ULW_ALPHA);
} else {