summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 20000ea0a9..7a68cdeb47 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -203,17 +203,16 @@ static inline QSize clientSize(HWND hwnd)
return qSizeOfRect(rect);
}
-// from qwidget_win.cpp/maximum layout size check removed.
-static bool shouldShowMaximizeButton(Qt::WindowFlags flags)
+// from qwidget_win.cpp
+static bool shouldShowMaximizeButton(const QWindow *w)
{
- if (flags & Qt::MSWindowsFixedSizeDialogHint)
+ const Qt::WindowFlags flags = w->flags();
+ if ((flags & Qt::MSWindowsFixedSizeDialogHint) || !(flags & Qt::WindowMaximizeButtonHint))
return false;
// if the user explicitly asked for the maximize button, we try to add
// it even if the window has fixed size.
- if (flags & Qt::CustomizeWindowHint &&
- flags & Qt::WindowMaximizeButtonHint)
- return true;
- return flags & Qt::WindowMaximizeButtonHint;
+ return (flags & Qt::CustomizeWindowHint) ||
+ w->maximumSize() == QSize(QWINDOWSIZE_MAX, QWINDOWSIZE_MAX);
}
// Set the WS_EX_LAYERED flag on a HWND if required. This is required for
@@ -432,7 +431,7 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag
style |= WS_SYSMENU;
if (flags & Qt::WindowMinimizeButtonHint)
style |= WS_MINIMIZEBOX;
- if (shouldShowMaximizeButton(flags))
+ if (shouldShowMaximizeButton(w))
style |= WS_MAXIMIZEBOX;
if (tool)
exStyle |= WS_EX_TOOLWINDOW;