From 260276642e131c6e84b10718e9f3dde774130e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 6 Feb 2025 16:57:49 +0100 Subject: [PATCH] macOS: Update window flags when updating content border thickness The titlebarAppearsTransparent property of NSWindow depends on whether the window has a NSWindowStyleMaskTexturedBackground, so we need to re-apply the window flags after updating the style mask to ensure we pick up the updated value for titlebarAppearsTransparent. Amends a1e6fed44964a3eb14045bf819d232d6cbad9f59. Fixes: QTBUG-133525 Change-Id: Ifff594f54569ac43ad27917e5f4b2f8a3bae5901 Reviewed-by: Volker Hilsheimer (cherry picked from commit bddc0198297828ba29e5cf4b39e07412a506a551) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/cocoa/qcocoawindow.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 8bcc200b57c..b742092b65b 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -2052,6 +2052,7 @@ void QCocoaWindow::applyContentBorderThickness(NSWindow *window) if (!m_drawContentBorderGradient) { window.styleMask = window.styleMask & ~NSWindowStyleMaskTexturedBackground; + setWindowFlags(QPlatformWindow::window()->flags()); [window.contentView.superview setNeedsDisplay:YES]; return; } @@ -2077,6 +2078,7 @@ void QCocoaWindow::applyContentBorderThickness(NSWindow *window) int effectiveBottomContentBorderThickness = 0; [window setStyleMask:[window styleMask] | NSWindowStyleMaskTexturedBackground]; + setWindowFlags(QPlatformWindow::window()->flags()); // Setting titlebarAppearsTransparent to YES means that the border thickness has to account // for the title bar height as well, otherwise sheets will not be presented at the correct