macOS: Allow programatically minimizing frameless windows

NSWindowStyleMaskMiniaturizable also controls programatic
minimize, in addition to the window decoration button.

Fixes: QTBUG-65637
Change-Id: Iac5fb483433441173d770f4fcfb9e93440b9fe6a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 556fbbea6e96c07c6cbd552c4179e5717e799acf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Morten Johan Sørvig 2021-01-11 15:32:16 +01:00 committed by Qt Cherry-pick Bot
parent 8118633466
commit 68b107f2b8

View File

@ -523,7 +523,10 @@ NSUInteger QCocoaWindow::windowStyleMask(Qt::WindowFlags flags)
NSUInteger styleMask = (frameless || !resizable) ? NSWindowStyleMaskBorderless : NSWindowStyleMaskResizable;
if (frameless) {
// No further customizations for frameless since there are no window decorations.
// Frameless windows do not display the traffic lights buttons for
// e.g. minimize, however StyleMaskMiniaturizable is required to allow
// programatic minimize.
styleMask |= NSWindowStyleMaskMiniaturizable;
} else if (flags & Qt::CustomizeWindowHint) {
if (flags & Qt::WindowTitleHint)
styleMask |= NSWindowStyleMaskTitled;