Fix invisible Menu Bar Layout pane on macOS 26 (white background, white text) - #972
Open
Pranav-Karra-3301 wants to merge 1 commit into
Open
Pranav-Karra-3301 wants to merge 1 commit into
Pranav-Karra-3301 wants to merge 1 commit into
Conversation
The menu bar window is fully transparent on macOS 26, so the strip that updateAverageColorInfo() captures has no pixels at or above the alpha threshold. averageColor() then divides by a zero pixel count and returns a CGColor with NaN components instead of nil. The NaN color renders the layout bars solid white, and it also forces the "Unable to display menu bar items" fallback text to white, leaving the whole pane blank white. - Return nil from averageColor() when no pixels qualify - Capture the menu bar window composited over the wallpaper window so the transparent menu bar picks up the wallpaper color behind it, matching the approach already used on the macos-26 branch - Use .primary for the layout bar placeholder text when no average color is available, so it stays legible on Color.defaultLayoutBar
Pranav-Karra-3301
force-pushed
the
fix-layout-bar-average-color
branch
from
August 21, 2026 15:39
ac70003 to
ef46185
Compare
Author
|
@jordanbaird pinging in case this got buried. Small, self contained fix for the blank Menu Bar Layout pane on Tahoe that several open issues trace back to (#716, #891, #916, #743). It ports the composite capture approach you already use on macos-26 over to main and guards the NaN divide. Happy to rebase onto #967 if you'd rather take that guard separately, or adjust anything else. |
1 task
|
Hit the same issue. Could you please merge this PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On macOS 26 (Tahoe), the Menu Bar Layout pane renders as solid white rounded rectangles with nothing visible inside. Reported in #716, #901, #761, #891, #916, #743.
Two bugs stack on top of each other:
MenuBarManager.updateAverageColorInfo()captures contains no pixels at or aboveaverageColor()'s alpha threshold.includedPixelCountends up 0, the component sums divide by zero, and the function returns a CGColor with NaN components instead of nil.Color(cgColor:)renders that NaN color as solid white regardless of the wallpaper. The wallpaper fallback branch never runs, because it is only reached when the menu bar window is missing entirely, not when its capture is transparent.averageColorInfo?.color.brightness ?? 0 > 0.67 ? .black : .white. NaN comparisons are always false, so the text is forced white. White text on the NaN white background is invisible, which is why the pane looks completely empty rather than showing the error.Pixel analysis of an affected machine (macOS 26.5.2, Ice 0.11.12) shows the section rows are uniform rgb(255, 255, 255) across every sampled pixel, consistent with the placeholder text being drawn white on white.
Fix
CGImage.averageColor(): return nil when no pixels qualify instead of dividing by zero. This is the same guard as Handle fully transparent average colors #967 by @offyotto, credit to them for spotting it first; happy to rebase if that lands.MenuBarManager.updateAverageColorInfo(): when both windows are present, capture the menu bar window composited over the wallpaper window, so the transparent Tahoe menu bar picks up the wallpaper color behind it. This ports the approach themacos-26branch already ships in 0.11.13-dev.2 tomain, while keepingmain's existing right-quarter sampling region. Pre-Tahoe behavior is effectively unchanged, since an opaque menu bar wins the composite. The original single-window branches remain as fallbacks.LayoutBar: when no average color is available, use.primaryfor the placeholder text instead of forcing white, so it stays legible onColor.defaultLayoutBarin both light and dark appearance (for example when screen recording permission is missing and the capture fails).Scope
This fixes the invisible white-on-white pane on
main. With it, a Tahoe user gets a correctly colored layout bar, and if item images still cannot be cached they see a legible "Unable to display menu bar items" message instead of a blank white row. Making the item images themselves work on Tahoe is the larger rework that lives on themacos-26branch (plus #922 for 26.4+), and is intentionally out of scope here.Testing
xcodebuildbuild; the only stubs needed were the Xcode-generated asset symbols and#Previewblocks).