Consider display 'notch' in terminal placement - #126
Merged
Conversation
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.
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.
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