Skip to content

macos: a window's glass bevel follows a live resize - #576

Merged
foxnne merged 2 commits into
app/glass-materialfrom
macos/glass-mask-resize
Oct 18, 2026
Merged

foxnne merged 2 commits into
app/glass-materialfrom
macos/glass-mask-resize

Conversation

@foxnne

@foxnne foxnne commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Part of the window material (fizzyedit/plans#27). Stacked on #549 (app/glass-material), where #565 put fizzy's window glass on a plain dvui app's windows.

The bug (the user, on run-dvui with Liquid Glass): a blurred patch in the window's top-left corner, with a diagonal edge, that appears and disappears while the window is resized.

Why: the frost and colour of a window of Liquid Glass are masked by the clearing bevel, a mask layer that each frame's look sizes (windowFeatherMask). A live resize grows the parts straight away (autoresizing), but the mask stayed at its old size until the next frame. AppKit's layers are anchored at the bottom-left, so as the window grew, the frost along its top fell outside the old mask for that moment, and the old mask's rounded corner showed as a diagonal.

The fix: each masked part (frost and colour) sizes its mask as AppKit resizes it. One shared observer listens for each part's frame changes (FizzyGlassMaskFollower), and windowGlassRemove unregisters a part as the glass is taken away. Fizzy's own windows install the same parts, so they get it too.

SDK impact

  • None

Verified

  • macOS (arm64, Zig 0.17.0): scripts/check-fmt.sh, zig build.
  • By hand: live-resize a run-dvui window on Liquid Glass (and a fizzy window): no patch in the corner.

🤖 Generated with Claude Code

The frost and colour of a window of Liquid Glass are masked by the clearing
bevel, a mask layer sized by each frame's look. A live resize grows the parts
at once, while the mask stayed at its old size until the next frame. The mask
is anchored at the bottom, so as the window grew, the frost along its top was
masked out for a frame and the old mask's rounded corner showed as a
diagonal, appearing and disappearing as the window was dragged. Each masked
part now sizes its mask as AppKit resizes it, through one frame-changed
observer, and unregisters when the glass is taken away.
@foxnne
foxnne marked this pull request as ready for review October 18, 2026 19:14
@foxnne
foxnne merged commit e17b4ce into app/glass-material Oct 18, 2026
11 checks passed
@foxnne
foxnne deleted the macos/glass-mask-resize branch October 18, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant