macOS: Don't make frameless tool windows miniaturizable

Amends 556fbbea6e96c07c6cbd552c4179e5717e799acf, which breaks
translucency of frameless tool windows. Possibly a bug in macOS, a
window being made miniaturizable should not have side effects on
background or translucency.

Fixes: QTBUG-95042
Task-number: QTBUG-65637
Change-Id: I651196e3cf8a9c59b250e5f1b4064cc4ded02372
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e71a5d5cc3c0337e7dbd5d571ecee5668baf8b63)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Volker Hilsheimer 2021-07-08 11:34:00 +02:00 committed by Qt Cherry-pick Bot
parent 222e895a39
commit e8d39c670e

View File

@ -525,8 +525,10 @@ NSUInteger QCocoaWindow::windowStyleMask(Qt::WindowFlags flags)
if (frameless) {
// Frameless windows do not display the traffic lights buttons for
// e.g. minimize, however StyleMaskMiniaturizable is required to allow
// programatic minimize.
styleMask |= NSWindowStyleMaskMiniaturizable;
// programatic minimize. However, for framless tool windows (e.g. dock windows)
// we don't want that, as it breaks translucency.
if (type != Qt::Tool)
styleMask |= NSWindowStyleMaskMiniaturizable;
} else if (flags & Qt::CustomizeWindowHint) {
if (flags & Qt::WindowTitleHint)
styleMask |= NSWindowStyleMaskTitled;