From 94e1d11d83587a6e643cf0bed07480761f531195 Mon Sep 17 00:00:00 2001 From: Jacob Fu <141651335+FuJacob@users.noreply.github.com> Date: Thu, 4 Jun 2026 20:41:18 -0700 Subject: [PATCH 1/2] Fix translucent menu bar popup background on macOS 26 The popup's only fill was `.containerBackground(.windowBackground, for: .window)`. `.windowBackground` is a translucent material, so on macOS 26 Liquid Glass the window behind the popup bleeds through and the native chrome and shadow detach from the content, most visible on light backgrounds (issue #492). Use an opaque `NSColor.windowBackgroundColor` instead, keeping the window-container placement from #403 so the popup renders as one solid rounded panel in light and dark. --- Cotabby/UI/MenuBarView.swift | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Cotabby/UI/MenuBarView.swift b/Cotabby/UI/MenuBarView.swift index 687f77ce..2e49dea5 100644 --- a/Cotabby/UI/MenuBarView.swift +++ b/Cotabby/UI/MenuBarView.swift @@ -367,11 +367,13 @@ private struct MenuBarWindowBackgroundModifier: ViewModifier { func body(content: Content) -> some View { if #available(macOS 15.0, *) { // MenuBarExtra's `.window` style already gives us native rounded window chrome. - // On newer macOS builds, leaving the root fill implicit can make SwiftUI draw a - // second, inset window-colored rectangle inside that chrome. A container background - // belongs to the hosting window instead of this view's local bounds, so the fill - // reaches the native rounded frame and avoids the double-border look. - content.containerBackground(.windowBackground, for: .window) + // Place the fill at the hosting window instead of this view's local bounds so it + // reaches the native rounded frame as one surface (avoids the older double-border + // look). Use an opaque window *color*, not the `.windowBackground` *material*: under + // macOS 26 Liquid Glass the material is translucent, so the desktop/app behind the + // popup bleeds through and the native chrome and shadow detach from the content, + // worst on light backgrounds (issue #492). An opaque fill reads as one solid panel. + content.containerBackground(Color(nsColor: .windowBackgroundColor), for: .window) } else { content } From f053b3c5584f23021c905dde59ec4ccd5c19279b Mon Sep 17 00:00:00 2001 From: Jacob Fu <141651335+FuJacob@users.noreply.github.com> Date: Thu, 4 Jun 2026 21:04:53 -0700 Subject: [PATCH 2/2] Limit opaque popup fill to macOS 26, keep material on 15-25 Greptile review: the Liquid Glass bleed-through (#492) is specific to macOS 26; `.windowBackground` renders correctly on macOS 15 through pre-26. Gate the opaque `windowBackgroundColor` to macOS 26+ and keep the material on 15-25 so the vibrant popup appearance is unchanged for the larger Sequoia base. --- Cotabby/UI/MenuBarView.swift | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Cotabby/UI/MenuBarView.swift b/Cotabby/UI/MenuBarView.swift index 2e49dea5..16f38dd5 100644 --- a/Cotabby/UI/MenuBarView.swift +++ b/Cotabby/UI/MenuBarView.swift @@ -365,15 +365,19 @@ struct MenuBarView: View { private struct MenuBarWindowBackgroundModifier: ViewModifier { @ViewBuilder func body(content: Content) -> some View { - if #available(macOS 15.0, *) { - // MenuBarExtra's `.window` style already gives us native rounded window chrome. - // Place the fill at the hosting window instead of this view's local bounds so it - // reaches the native rounded frame as one surface (avoids the older double-border - // look). Use an opaque window *color*, not the `.windowBackground` *material*: under - // macOS 26 Liquid Glass the material is translucent, so the desktop/app behind the - // popup bleeds through and the native chrome and shadow detach from the content, - // worst on light backgrounds (issue #492). An opaque fill reads as one solid panel. + if #available(macOS 26.0, *) { + // macOS 26 Liquid Glass renders the `.windowBackground` *material* as translucent + // glass, so the app/desktop behind the popup bleeds through and the native chrome and + // shadow detach from the content, worst on light backgrounds (issue #492). Fill with + // an opaque window *color* instead so the popup reads as one solid rounded panel. content.containerBackground(Color(nsColor: .windowBackgroundColor), for: .window) + } else if #available(macOS 15.0, *) { + // MenuBarExtra's `.window` style already gives us native rounded window chrome. Place + // the fill at the hosting window instead of this view's local bounds so it reaches the + // native rounded frame as one surface (avoids the double-border look fixed in #403). + // The `.windowBackground` material renders correctly on macOS 15 through pre-26, so + // keep it there to preserve the vibrant appearance and only patch the 26 regression. + content.containerBackground(.windowBackground, for: .window) } else { content }