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>
This commit is contained in:
Timur Pocheptsov 2022-10-24 17:58:12 +02:00 committed by Qt Cherry-pick Bot
parent 12968a819a
commit 0c5f294217

View File

@ -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