Skip to content

fix(gui,macos): balance see-through window chrome and corners - #16

Open
Mirr0ch1 wants to merge 5 commits into
RoversX:mainfrom
Mirr0ch1:fix/translucent-ui-spacing
Open

Mirr0ch1 wants to merge 5 commits into
RoversX:mainfrom
Mirr0ch1:fix/translucent-ui-spacing

Conversation

@Mirr0ch1

@Mirr0ch1 Mirr0ch1 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Four seams in a see-through window, fixed without changing the terminal's rows or columns:

  1. Pane header sat high. A pane's nav bar was painted only to its own height, leaving the window's top padding below it as terminal ground. The pill was then centred in the bar alone, so the space above it was smaller than the space below. The header band now paints and takes clicks through that padding, and the pill is centred in the whole band. The terminal grid is untouched.

  2. The bottom quote was clipped and moved in cell-sized steps. The quote lives in the gutter below the last row, but that gutter is only the padding plus what the row grid left over: centring the quote in it made the quote climb in jumps as rows were added or removed, and when the gutter was shorter than its line box the box was pushed below the window edge. The quote's visible ink is now anchored a small margin above the window's bottom edge, so it follows the edge pixel for pixel; when the gutter is short it rises over the line box of the last row instead of being clipped. Changing the quote font size still does not reflow the terminal.

  3. A TUI's painted surface had square corners inside the rounded, see-through window. A full-screen TUI such as OpenCode paints a rectangular background into the terminal grid. The corner wedges outside a rounded corner now go through a dedicated pass that clears their alpha while leaving RGB alone, so the glass behind the window shows through instead of a solid approximation of it. OpenGL and WebGPU each get an erase pipeline for that pass. It is armed only when the visible grid's top and bottom edges carry a background of the program's own, so a shell prompt or a one-off coloured cell does not lose part of its first glyph.

  4. macOS content view clipping. AppKit rounds the window frame but does not reliably clip the full-size content view underneath it while the window is see-through; the content view, the Liquid Glass and its blur are clipped to the window's radius, and the clip is removed when the window is opaque or no longer uses full-size content.

Validation

  • Linux Xvfb: the pane-header and quote spacing were checked before/after; a vertical split was checked too.
  • The terminal-corner pass was verified on the OpenGL renderer with a full-screen coloured test TUI; the corner wedges are emitted on their dedicated layer.
  • cargo test -p wezterm-gui: 1306 passed, 1 ignored.
  • The quote anchor has unit coverage: one pixel of window bottom moves it one pixel, and it is never placed below the window.
  • cargo test -p thinkterm-render: 35 passed.
  • cargo check -p wezterm-gui and cargo check -p thinkterm-web.
  • An ad-hoc macOS arm64 build (0.3.6-ui.6) was built locally on Apple silicon, installed, and tested with OpenCode and Liquid Glass: the terminal's painted surface now has rounded corners and the glass shows through them.
  • The terminal-corner pass is armed only when top, bottom and a middle cell all carry a program background; a shell prompt or a prompt plus a bottom status line is left alone.

No new dependencies.

Third-party material

None.

Contributor agreement

I agree to the ThinkTerm Contributor Agreement version 1.1 for this contribution.

@Mirr0ch1
Mirr0ch1 force-pushed the fix/translucent-ui-spacing branch 2 times, most recently from 10903e8 to 0553c45 Compare October 26, 2026 19:48
A pane's nav bar stopped at its own height, leaving the window's top
padding below it as terminal ground. The pill was then centred in the
bar alone, so it read high against the first terminal row. Extend the
header band through that padding, paint it as chrome and take clicks
there, and centre the pill in the band. The band now has equal space
above and below its pill.

The bottom quote is drawn in the gutter below the last row, but the
default half-cell bottom padding is shorter than its line box. Centring
the box pushed it below the window edge and clipped it. Centre the ink
instead, and let it rise over the line box of the last row when the
gutter is too short, with a small bottom margin.

The quote now stays whole at the bottom of short windows and reads
centred in its gutter.
AppKit rounds the window frame, but does not reliably clip the full-size
content view underneath it while the window is see-through. The terminal
then showed square corners inside the rounded frame, and inside the
Liquid Glass its content view is a separate surface that the effect
view's rounding does not reach either.

Clip the content view, and the glass and blur it can sit in, to the
window's own corner radius while the window is see-through. Opaque
windows and windows without full-size content are left to AppKit.
config_did_change runs while the window is still being built, before
AppKit has necessarily settled the window's private corner radius. A
window opened already see-through could therefore keep a square content
view until some later configuration change. Reapply the radius to the
content view, the glass and its blur once the window is on screen.
A full-screen TUI such as OpenCode paints a rectangular surface inside
the rounded window, leaving its corners square. Paint a terminal-corner
pass after the content that clears the alpha channel in the wedge outside
a rounded corner while leaving RGB alone; the see-through window then
shows the glass behind those wedges instead of a painted approximation
of it.

The pass is armed only when the visible grid's top and bottom edges carry
a background of the program's own, so a shell prompt or a one-off
coloured cell does not lose part of its first glyph. It follows the same
radius on OpenGL and WebGPU, and does not change the terminal's rows or
columns.
@Mirr0ch1
Mirr0ch1 force-pushed the fix/translucent-ui-spacing branch from 0553c45 to b50b69f Compare October 26, 2026 19:51
The quote was placed inside the gutter below the last terminal row.
That gutter is only the padding plus what the row grid left over, so
it grows by whole cells as the window grows and collapses when a row
is added. Centring the quote in it made the quote climb in cell-sized
steps while the window edge was dragged, and when the gutter was
shorter than the line box the box was pushed past the window edge and
clipped.

Anchor the visible ink a small margin above the window's bottom edge
instead. The quote now follows the edge pixel for pixel at every window
height. When the gutter is too short, the ink rises over the last row's
line box rather than out of the window; it is never clipped.
@Mirr0ch1

Copy link
Copy Markdown
Contributor Author

Pushed a follow-up commit for item 2: the quote is no longer centred in the leftover gutter. It is anchored by its visible ink a fixed margin above the window's bottom edge, so live-resizing the window moves it pixel for pixel instead of in cell-sized jumps, and it cannot be pushed below the window. The same reason kept the earlier version from fully fixing what testing showed: the gutter is measured from the row grid, which snaps by whole cells.

This branch has not been deployed

No deployments
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