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.

Pick-to: 6.2 6.1 5.15
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>
This commit is contained in:
Volker Hilsheimer 2021-07-08 11:34:00 +02:00
parent d52bb250c3
commit e71a5d5cc3

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;