From 1e367f2f8ccb95f9bdf93e3d6ddbb38ce2a9d13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Tue, 29 Jul 2025 15:41:57 +0200 Subject: [PATCH] Hide warning on deprecated NSWindowStyleMaskTexturedBackground MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The enum was deprecated in macOS 10.14. The warning does show up in all Qt builds (-developer-build or not). Most users won't be qualified to do anything about the warning, so let's hide it for now. Pick-to: 6.9 6.10 Task-number: QTBUG-138829 Change-Id: I08007164eecbac4dc9708a615f34462f6f8de852 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoawindow.mm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index d0abb8e38c4..bca3c9b6f37 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -642,9 +642,9 @@ NSUInteger QCocoaWindow::windowStyleMask(Qt::WindowFlags flags) if (type == Qt::Tool) styleMask |= NSWindowStyleMaskUtilityWindow; - // FIXME: Remove use of deprecated style mask + // FIXME (QTBUG-138829) if (m_drawContentBorderGradient) - styleMask |= NSWindowStyleMaskTexturedBackground; + styleMask |= QT_IGNORE_DEPRECATIONS(NSWindowStyleMaskTexturedBackground); if (flags & Qt::ExpandedClientAreaHint) styleMask |= NSWindowStyleMaskFullSizeContentView; @@ -768,6 +768,7 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags) if (m_view.window.ignoresMouseEvents != ignoreMouse) m_view.window.ignoresMouseEvents = ignoreMouse; + // FIXME (QTBUG-138829) m_view.window.titlebarAppearsTransparent = (flags & Qt::NoTitleBarBackgroundHint) || (m_view.window.styleMask & QT_IGNORE_DEPRECATIONS(NSWindowStyleMaskTexturedBackground)); } @@ -2055,7 +2056,8 @@ void QCocoaWindow::applyContentBorderThickness(NSWindow *window) return; if (!m_drawContentBorderGradient) { - window.styleMask = window.styleMask & ~NSWindowStyleMaskTexturedBackground; + // FIXME (QTBUG-138829) + window.styleMask = window.styleMask & QT_IGNORE_DEPRECATIONS(~NSWindowStyleMaskTexturedBackground); setWindowFlags(QPlatformWindow::window()->flags()); [window.contentView.superview setNeedsDisplay:YES]; return; @@ -2081,7 +2083,8 @@ void QCocoaWindow::applyContentBorderThickness(NSWindow *window) int effectiveBottomContentBorderThickness = 0; - [window setStyleMask:[window styleMask] | NSWindowStyleMaskTexturedBackground]; + // FIXME (QTBUG-138829) + [window setStyleMask:[window styleMask] | QT_IGNORE_DEPRECATIONS(NSWindowStyleMaskTexturedBackground)]; setWindowFlags(QPlatformWindow::window()->flags()); // Setting titlebarAppearsTransparent to YES means that the border thickness has to account