Skip to content

Consider display 'notch' in terminal placement - #126

Merged
zackslash merged 7 commits into
mainfrom
feature/notch-inset
Aug 28, 2026
Merged

Consider display 'notch' in terminal placement#126
zackslash merged 7 commits into
mainfrom
feature/notch-inset

Conversation

@zackslash

@zackslash zackslash commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Adds support for displays with a 'notch' and adds an inset so that the terminal input is not obscured by the notch.

Also adds an additional test script so that this can be tested in the emulator

Devices with a top display cutout (e.g. Jolla Phone 2026) render the top
terminal rows under the notch. The grid now shifts below the cutout via
topPadding, controlled by a new setting: Auto (Screen.topCutout from the
system), Off, or Manual pixels. Manual exists because JP2-era firmware
ships no cutout dconf key, so auto-detect finds nothing there. Portrait
only; in landscape the cutout sits at a side edge.
Writes/empties the Silica cutout dconf key on the emulator so notch-inset
behavior can be QA'd without a notched device: 'on' simulates a centered
punch-hole (Screen.topCutout goes live), 'off' empties the list to
reproduce the JP2-today case where the adaptation ships no key and only
Manual inset works, 'reset' restores the vendor default the default
emulator profile ships.
The notch inset band is empty whenever the viewport sits at the bottom;
when the user scrolls up into history, the k rows above the viewport now
render into the band, so the notch space is used instead of blank. The
live grid still starts below the notch; grid size is untouched (no
SIGWINCH). Band rows are fetched via a signature-gated grid_ref walk
(never per frame), rendered through the existing atlas path with manual
raw-style resolution (palette, inverse, invisible), in a separate VBO;
the top background strip shrinks while the band is active. No selection,
links, search, or cursor in the band by design.
VIEWPORT_ACTIVE is true at the bottom (scrollViewportToBottom scrolls only
when it is false); the band gate tested it directly, so the band rendered
history at rest and hid while scrolled up. Invert the term.
Gate the band on scroll offset > 0 (rows exist above the viewport)
instead of a scrolled-up viewport, so lines scrolling off the top while
output grows keep filling the band rather than leaving it blank until
the user scrolls. The fresh prompt still starts below the notch.
Fold the render-state dirty flag into the band signature: a capped
scrollback renumbers rows while offset and total stay constant, so
without it the band froze on stale lines during sustained output once
history hit the cap. Also force a strip rebuild when k or topPadding
changes without a band flip, drop the redundant total field, deduplicate
the four QML inset sites into applyNotchInset(), guard against a null
topCutout, correct stale comments (offset>0 gating, per-frame streaming
cost, single-thread assumption), and tighten the notch script (status
wording, arg validation).
The auto formula already matches how Silica itself handles cutouts
(StatusArea grows by Screen.topCutout.height in portrait when the
system reports a cutout), and no first-party app ships a manual cutout
override. The JP2 no-key rationale for Manual mode was an emulator
inference contradicted by real-device behavior: lipstick on JP2 has
notch-aware gesture zones and no owner reports an occluded clock, both
of which require the cutout to be reported. notchInset() is now
auto-only; persisted terminal/notchInsetMode and terminal/notchInsetPx
values on existing installs become inert.
@zackslash
zackslash merged commit 3d8a4db into main Aug 28, 2026
3 checks passed
@zackslash
zackslash deleted the feature/notch-inset branch August 28, 2026 20:51
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