Repository navigation
fix: NSSwitch and NSSlider bezels draw under the macOS 26 design, where displayRectIgnoringOpacity left them empty - #126
Merged
Conversation
…re displayRectIgnoringOpacity left them empty A process linked against the macOS 26 SDK (Bun 1.4 is) gets the new control design, in which NSSwitch and NSSlider draw through their layers. displayRectIgnoringOpacity:inContext: into a foreign context then draws nothing, so react-x11's native <Switch> and <Slider> were invisible while still taking clicks and drags. Both draw paths (drawControlIntoSurface and the legacy drawControl) now capture the view with cacheDisplayInRect: into a bitmap rep of the surface's size, which renders the layer tree; on the older design the pixels are byte-identical to before. control-bezels.js now checks every kind inks its frame in both appearances. Co-Authored-By: Claude Opus 5.5 <[email protected]>
sidorares
added a commit
to sidorares/react-x11
that referenced
this pull request
Oct 21, 2026
…gn, on @windowkit/appkit 0.30.1 (#979) A process linked against the macOS 26 SDK — Bun 1.4 is, Node 24 is not — gets AppKit's new control design, where NSSwitch and NSSlider draw through their layers and the bridge's offscreen capture came out empty: the controls laid out, took clicks and drags, and showed no pixels. @windowkit/appkit 0.30.1 (windowkit/appkit#126) captures them with cacheDisplayInRect:, byte-identical on the older design. Co-authored-by: Claude Opus 5.5 <[email protected]>
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
A process linked against the macOS 26 SDK gets AppKit's new control design. Bun 1.4.3 is (SDK 26.5); Node 24 is not (SDK 15). Under the new design, NSSwitch and NSSlider draw through their layers, and
displayRectIgnoringOpacity:inContext:into a foreign context draws nothing. react-x11's native<Switch>and<Slider>were invisible under Bun, though they still took clicks and drags. Cell-based kinds (push, checkbox, radio, popup) were unaffected because they draw withdrawWithFrame:.A standalone check built against each SDK, measuring ink pixels:
displayRectIgnoringOpacity(switch)cacheDisplayInRect:toBitmapImageRep:(switch)Fix
Both draw paths (
drawControlIntoSurfaceinbackend.mmand the legacydrawControlinaddon.mm) now capture a view control withcacheDisplayInRect:into a bitmap rep at the surface's pixel size, then draw that rep into the context.Verified
test/control-bezels.jsgains an "every kind draws ink" check, light and dark. Under Bun it fails for slider and switch before the fix and passes after.test/threaded-verbs.jspasses under Node and Bun.examples/fonts.jsxunder Bun with this build shows its switches and sliders.Not in this PR
Under Bun,
control-bezels.jsstill fails its existing push-vs-flexiblePush checks ("one line is one push tall", then a buffer-bounds throw). The macOS 26 push bezel has different geometry, so those expectations assume the old design. That's a separate gap, and CI on an SDK-15 Node never sees it.🤖 Generated with Claude Code