From 44e68b90266336d3d46279eddcbb2a4a775f0d2a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 30 Oct 2013 13:19:26 +0200 Subject: Windows: Do not use blend function for GL windows with alpha. Task-number: QTBUG-34376 Change-Id: I81a5ee6ff14e5472eb1f3846577d86b615be34e0 Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (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 1909e0313b..d3d381ae28 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -305,7 +305,7 @@ bool QWindowsWindow::setWindowLayered(HWND hwnd, Qt::WindowFlags flags, bool has #endif // Q_OS_WINCE } -static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qreal level) +static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, bool openGL, qreal level) { #ifdef Q_OS_WINCE // WINCE does not support that feature and microsoft explicitly warns to use those calls Q_UNUSED(hwnd); @@ -314,8 +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 (hasAlpha && (flags & Qt::FramelessWindowHint)) { - // Windows with alpha: Use blend function to update. + if (hasAlpha && !openGL && (flags & Qt::FramelessWindowHint)) { + // Non-GL 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 { @@ -661,7 +661,7 @@ void WindowCreationData::initialize(HWND hwnd, bool frameChange, qreal opacityLe EnableMenuItem(systemMenu, SC_CLOSE, MF_BYCOMMAND|MF_GRAYED); } - setWindowOpacity(hwnd, flags, hasAlpha, opacityLevel); + setWindowOpacity(hwnd, flags, hasAlpha, isGL, opacityLevel); } else { // child. SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, swpFlags); } @@ -1745,7 +1745,9 @@ void QWindowsWindow::setOpacity(qreal level) if (m_opacity != level) { m_opacity = level; if (m_data.hwnd) - setWindowOpacity(m_data.hwnd, m_data.flags, window()->format().hasAlpha(), level); + setWindowOpacity(m_data.hwnd, m_data.flags, + window()->format().hasAlpha(), testFlag(OpenGLSurface), + level); } } -- cgit v1.2.3 From a922b94c2fa273dfc3915c840b4b8518163d06f1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 31 Oct 2013 16:41:19 +0100 Subject: Windows: Do not detect full-screen state for child windows. Introduced by a1db174ea98fab8669da498639895bac4c894baf (Fix window state handling). Task-number: QTBUG-34477 Change-Id: I4c92edddef346f9d7c4741f2f9784e9f686e9cda Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 2 +- 1 file changed, 1 insertion(+), 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 d3d381ae28..44fd97e1aa 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1548,7 +1548,7 @@ static const QScreen *effectiveScreen(const QWindow *w) bool QWindowsWindow::isFullScreen_sys() const { - return geometry_sys() == effectiveScreen(window())->geometry(); + return window()->isTopLevel() && geometry_sys() == effectiveScreen(window())->geometry(); } /*! -- cgit v1.2.3 From f48bc3ef40ec0176497896071c487b5326cd66c1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 7 Nov 2013 10:38:56 +0100 Subject: Add a warning message when a WM_DESTROY not triggered by Qt is received. Task-number: QTBUG-34503 Change-Id: I7a1e06b34deaf8e595f4986114701480bdcf219c Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 1 + 1 file changed, 1 insertion(+) (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 44fd97e1aa..2ea02cd4d4 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -929,6 +929,7 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const WindowData &data) : QWindowsWindow::~QWindowsWindow() { + setFlag(WithinDestroy); #ifndef Q_OS_WINCE if (testFlag(TouchRegistered)) QWindowsContext::user32dll.unregisterTouchWindow(m_data.hwnd); -- cgit v1.2.3 From 6ff08b7db3d4f93b38ae769413d3f3377b3d272b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 7 Nov 2013 10:53:42 +0100 Subject: Windows: Do not set transient parent on popups. Analoguous to Window creation code. Task-number: QTBUG-34503 Change-Id: I3cf7d58999bff5b106ca9d2e2c6f550e35f9db9a Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 2 ++ 1 file changed, 2 insertions(+) (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 2ea02cd4d4..d2fb481824 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1123,6 +1123,8 @@ QPoint QWindowsWindow::mapFromGlobal(const QPoint &pos) const void QWindowsWindow::updateTransientParent() const { #ifndef Q_OS_WINCE + if (window()->type() == Qt::Popup) + return; // QTBUG-34503, // a popup stays on top, no parent, see also WindowCreationData::fromWindow(). // Update transient parent. const HWND oldTransientParent = GetAncestor(m_data.hwnd, GA_PARENT) == GetDesktopWindow() ? GetAncestor(m_data.hwnd, GA_ROOTOWNER) : HWND(0); -- cgit v1.2.3 From cd93a2c0e14090cecbe3e83748937dcd15d98dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Fri, 15 Nov 2013 15:36:18 +0000 Subject: Windows: Fix bug where windows stopped painting after a restore. This is an improvement over 6800728d where we only fixed it if the window was in "normal" state (Qt::WindowNoState) before minimizing. With this patch, if the window was previously maximized or full-screen it will also get the expose events when being restored. Change-Id: I4a30423145e0999c5d0a5ee2a989730b83f4e3f2 Reviewed-by: Friedemann Kleint Reviewed-by: Nicolas Arnaud-Cormos --- src/plugins/platforms/windows/qwindowswindow.cpp | 2 ++ 1 file changed, 2 insertions(+) (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 d2fb481824..58047124a1 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1500,6 +1500,8 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowState state) handleHidden(); QWindowSystemInterface::flushWindowSystemEvents(); // Tell QQuickWindow to stop rendering now. break; + case Qt::WindowMaximized: + case Qt::WindowFullScreen: case Qt::WindowNoState: { // QTBUG-17548: We send expose events when receiving WM_Paint, but for // layered windows and transient children, we won't receive any WM_Paint. -- cgit v1.2.3