Conversation
CGWindowID(window.windowNumber) traps on overflow when windowNumber is out of UInt32 range, which happens for menu bar item windows on macOS 26 (see jordanbaird#580, jordanbaird#977 upstream). Switch both call sites to the failable CGWindowID(exactly:) initializer so an out-of-range value degrades to nil instead of crashing the app. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
WindowInfo(windowID:) is itself failable, so mapping into it with .map produced a nested Optional (WindowInfo??) instead of flattening, which failed to typecheck. Also ignore local .build/ derived data. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ream Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
It's a personal workspace tracking file, not meant to be part of the upstream PR diff — kept on main in the fork instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
Both
ControlItem.windowIDand the frame-change handler inIceBarPanelconvertNSWindow.windowNumbertoCGWindowIDwith the non-failable initializer:windowNumberisInt,CGWindowIDisUInt32, and this initializer traps onoverflow rather than returning nil. On macOS 26,
windowNumbercan return a valueoutside
UInt32's range for menu bar item windows (reported in #580 as consistentlygreater than
UInt32.max), which crashes the app withEXC_BREAKPOINT/SIGTRAP—matching the stack traces in #977 and other recent crash reports, and one I hit
myself on 0.11.12.
This swaps both call sites to the failable
CGWindowID(exactly:), so anout-of-range value degrades to
nil(the existing optional-chaining call sitesalready handle that gracefully) instead of crashing the process.
Ice/MenuBar/ControlItem/ControlItem.swift—windowIDgetterIce/UI/IceBar/IceBar.swift— the control item's frame-change publisher, used todetect when the menu bar is hidden by the system
Testing
~/Library/Logs/DiagnosticReports/, versus multiple same-day crashes on 0.11.12before this change.
Fixes #977. Likely related to #580, #786, #867 (macOS 26 crashes around showing
hidden items / the Ice Bar).
🤖 Generated with Claude Code