summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2022-10-24 17:58:12 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-10-29 04:17:59 +0000
commit0c5f294217e0003a74c97f6326dd9654f13199ea (patch)
tree6abc8838e807e637485ca1241c595bcc6b50b78e
parent12968a819ab27ec5fb21c32cbd0737164cb43711 (diff)
qnswindow (-backgroundColor) - return 'clear color' for Qt::Popup
That's what we initially did for borderless windows and we need it in order to draw rounded corners for context menus. Fixes: QTBUG-106108 Change-Id: I6e4254b714ad7a094aa295546d5ac7fba5e21b13 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 6a839e0ae4cb1eddd290d64b152a2571f3586ed2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/platforms/cocoa/qnswindow.mm9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm
index cce76e4b20..8d4a0617de 100644
--- a/src/plugins/platforms/cocoa/qnswindow.mm
+++ b/src/plugins/platforms/cocoa/qnswindow.mm
@@ -296,8 +296,13 @@ OSStatus CGSClearWindowTags(const CGSConnectionID, const CGSWindowID, int *, int
// we assume that if you have translucent content, without a
// frame then you intend to do all background drawing yourself.
const QWindow *window = m_platformWindow ? m_platformWindow->window() : nullptr;
- if (!self.opaque && window && window->flags().testFlag(Qt::FramelessWindowHint))
- return [NSColor clearColor];
+ if (!self.opaque && window) {
+ // Qt::Popup also requires clearColor - in qmacstyle
+ // we fill background using a special path with rounded corners.
+ if (window->flags().testFlag(Qt::FramelessWindowHint)
+ || (window->flags() & Qt::WindowType_Mask) == Qt::Popup)
+ return [NSColor clearColor];
+ }
// This still allows you to have translucent content with a frame,
// where the system background (or color set via NSWindow) will