From 2f6d572dad031d2757a0f307cba56ae7b01c390a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 14 Sep 2021 18:26:40 +0200 Subject: macOS: Compute NSWindow background color without checking styleMask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The check for styleMask == NSWindowStyleMaskBorderless to decide whether to clear the NSWindow background was broken, as NSWindowStyleMaskBorderless has the value 0, but is only supposed to be compared to its companion NSWindowStyleMaskTitled (with value 1). A window can perfectly well be NSWindowStyleMaskBorderless and NSWindowStyleMaskMiniaturizable e.g., so by comparing directly to NSWindowStyleMaskBorderless instead of masking to the first bit first we ended up making miniaturizable windows non-translucent. We now check the Qt::FramelessWindowHint directly, and also whether the window is opaque. Ideally we'd have QWindow flags that could plumb WA_NoSystemBackground from Qt Widgets, as well as a background color property on QWindow to control the system background, but in the meantime we'll have to use the FramelessWindowHint heuristic. The QWidget docs have been updated to reflect this. Task-number: QTBUG-95042 Pick-to: 6.2 Change-Id: I0d40eecace60883c205ebb8c76cef1092cdf1144 Reviewed-by: Morten Johan Sørvig --- src/widgets/kernel/qwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets/kernel/qwidget.cpp') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index fcb18d7c18..7e0d2c7291 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -792,6 +792,8 @@ void QWidget::setAutoFillBackground(bool enabled) and a compositing window manager. \li Windows: The widget needs to have the Qt::FramelessWindowHint window flag set for the translucency to work. + \li \macos: The widget needs to have the Qt::FramelessWindowHint window flag set + for the translucency to work. \endlist -- cgit v1.2.3