Windows: Fix corner case where frameless windows would cover the taskbar.

In commit 0c936ca83c 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 <Friedemann.Kleint@digia.com>
This commit is contained in:
Sérgio Martins 2013-12-06 15:12:50 +00:00 committed by The Qt Project
parent 29b0a565e9
commit fbc6240cc6

View File

@ -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())) {