From fbc6240cc6f4846fbde1ee8dff6cda28863ed55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Fri, 6 Dec 2013 15:12:50 +0000 Subject: [PATCH] Windows: Fix corner case where frameless windows would cover the taskbar. In commit 0c936ca83c40b73f30195a619900f2be98b9e968 we fixed the case where the window was maximized programmatically, but if the window gets restored by clicking on the taskbar we don't get to set WithinMaximize flag, since we immediately get the WM_GETMINMAXINFO request from Windows. To reproduce the problem, run tests/manual/windowflags, remove frames, maximize, minimize, and restore by clicking on the taskbar. Task-number: QTBUG-8361 Change-Id: I8a7cf4fccbb2c3dac5f570848501ac1e8d2c2307 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowswindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 89b5bdbf0e..51902385e1 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1912,7 +1912,8 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const const QWindowsGeometryHint hint(window(), m_data.customMargins); hint.applyToMinMaxInfo(m_data.hwnd, mmi); - if (testFlag(WithinMaximize) && (m_data.flags & Qt::FramelessWindowHint)) { + if ((testFlag(WithinMaximize) || (window()->windowState() == Qt::WindowMinimized)) + && (m_data.flags & Qt::FramelessWindowHint)) { // This block fixes QTBUG-8361: Frameless windows shouldn't cover the // taskbar when maximized if (const QScreen *screen = effectiveScreen(window())) {