From b7b573ad6d9f50ebff87f5c6204225366a1675bd Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 10 Sep 2013 12:03:07 +0200 Subject: Windows: Fix window opacity for non-translucent windows. Use the UpdateLayeredWindow() functions only for windows with alpha. Task-number: QTBUG-33025 Change-Id: I64b0c28ee0997cd3d09dc76babe105ed474c6835 Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index ace18ddf5b..9d87eaa110 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -250,7 +250,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 { -- cgit v1.2.3