macOS: Allow programatically minimizing frameless windows

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

Fixes: QTBUG-65637
Pick-to: 6.2 6.1 5.15 5.12
Change-Id: Iac5fb483433441173d770f4fcfb9e93440b9fe6a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
bb10
Morten Johan Sørvig 2021-01-11 15:32:16 +01:00 committed by Tor Arne Vestbø
parent 704f035499
commit 556fbbea6e
1 changed files with 4 additions and 1 deletions

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;