Skip to content

Keep the bar mapped while hidden so revealing it is instant - #6677

Merged
dhh merged 4 commits into
omacom:quattrofrom
vivek7405:bar-instant-show
Aug 10, 2026
Merged

dhh merged 4 commits into
omacom:quattrofrom
vivek7405:bar-instant-show

Conversation

@vivek7405

@vivek7405 vivek7405 commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Toggling the bar off is instant, but toggling it back on takes roughly ten times longer. Measured on an Apple Studio Display, 5120x2880 at scale 2 for a 2560x1440 logical space, by polling hyprctl layers for the omarchy-bar surface:

show hide
before 155-175ms 20ms
after 10-14ms 11-14ms

The first reveal after a cold start measured 400-595ms.

Cause

BarPanel bound visible to !barHidden, so hiding unmapped the layer surface and released the scene graph with it. Every reveal then had to rebuild all of that: a new layer surface, a configure roundtrip, re-shaped glyphs, re-uploaded textures, and a first frame before anything appeared. Tearing it down is a single destroy, which is why hiding was always fast.

The exclusive zone reflow is not the cause. Show latency was the same on an empty workspace (138-181ms) as on one with three tiled windows (155-175ms), and windows finished moving about 15ms after the bar was already on screen. The cold-start outliers point the same way, since work that speeds up once caches are warm is work being redone.

Change

A hidden bar now stays mapped and parks one bar width past whichever edge it is anchored to, with its exclusion zone dropped so it reserves no space. Showing becomes a margin change rather than a rebuild.

barHidden keeps its meaning, so the omarchy-toggle-bar flag contract and the notification anchoring that reads it are untouched. No animation was added, since default/hypr/apps/omarchy-shell.lua sets no_anim on this layer and the toggle should stay instant in both directions.

Testing

The timings above and the checks below were measured on an Apple Studio Display (5120x2880 at scale 2):

  • All four bar positions park fully offscreen and reveal in 10-14ms
  • A parked bar does not appear in grim screenshots
  • Widgets keep running while parked. The update widget completed a check and showed the correct icon on the first revealed frame, and weather fetches fired on schedule.
  • Clicks at the screen edge are unaffected while the bar is parked

Because a hidden bar is now mapped, layer_present no longer proves the bar is visible, so session-test.sh asserts on-screen geometry through a new layer_on_screen helper. Layer boxes are in logical coordinates, so the helper divides monitor dimensions by scale. It was checked against all four parked positions, the background layer, and a nonexistent layer.

Multi-monitor was then tested side by side, with the Apple Studio Display next to a Framework Laptop 13 panel (2880x1920 at scale 2). The bar renders on both outputs and hides and reveals correctly on both. A bar parked past the inner edge of either display does not bleed onto its neighbour, in both directions: the right-positioned bar on the left display parks exactly on the right display's origin, and the left-positioned bar on the right display parks inside the left display, and neither shows up in a capture of the neighbouring output.

Stacking the same two displays vertically covers the case where a top or bottom bar parks toward an adjacent screen rather than into empty space. With the smaller display above the larger one, the lower display's top bar parks 26px up into the upper display's area, and the upper display's bottom bar parks exactly on the lower display's origin. Neither appears in a capture of the neighbouring output, measured against strips that hold only wallpaper so an unchanged capture means nothing was drawn.

Hiding the bar set the panel invisible, which unmaps the layer surface and
releases the scene graph with it. Every reveal then had to rebuild all of
it: a new layer surface, a configure roundtrip, re-shaped glyphs and
re-uploaded textures, and a first frame before anything appeared.

Measured on a 2560x1440 screen, showing took 155-175ms against 20ms to
hide, and 400-595ms on the first reveal after a cold start. Splitting the
cost showed the exclusive-zone reflow was not to blame: show latency was
the same on an empty workspace as on a tiled one, and windows finished
moving ~15ms after the bar was already on screen.

Park the bar one bar-width past its anchored edge instead, and drop its
exclusion zone while hidden. The surface stays alive, so showing is only
a margin change: 10-14ms in both directions, at every bar position.

Since a hidden bar is now mapped, layer_present no longer proves the bar
is visible; the session acceptance test asserts on-screen geometry.
Copilot AI balanced review requested due to automatic review settings August 10, 2026 11:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Keeps hidden bars mapped off-screen for faster reveal while preserving layout behavior.

Changes:

  • Parks hidden bars beyond their anchored edge.
  • Drops hidden-bar exclusion zones.
  • Adds geometry-aware shell and acceptance checks.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
shell/plugins/bar/Bar.qml Keeps hidden bars mapped and parked off-screen.
test/shell.d/bar-test.sh Adds source-level bar behavior assertions.
test/acceptance.d/base-test.sh Adds layer visibility geometry detection.
test/acceptance.d/session-test.sh Uses geometry checks for core layers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/acceptance.d/session-test.sh Resolved
Comment thread test/acceptance.d/base-test.sh Resolved
Copilot AI review requested due to automatic review settings August 10, 2026 11:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (2)

test/acceptance.d/base-test.sh:99

  • This geometry is incorrect for portrait monitors. Hyprland keeps width/height in the untransformed orientation, while layer boxes use transformed logical coordinates; this repository already swaps them for transforms 1 and 3 in bin/omarchy-capture-region:47-58. As written, a layer parked beyond the portrait monitor's shorter edge can be reported on-screen (and vice versa). Derive transformed logical bounds before the intersection check, and add a rotated-monitor case to the helper test.
        .x + .w > 0 and .x < $m.width / $m.scale and
        .y + .h > 0 and .y < $m.height / $m.scale

shell/plugins/bar/Bar.qml:965

  • This new binding makes the barHidden property documentation at Bar.qml:29-31 stale: it still says the flag is wired to BarPanel.visible, although visibility no longer depends on it. Update that comment to describe the margin/exclusion behavior so future changes do not restore the old unmapping contract by mistake.
    visible: !remapGuard.remapping
    exclusionMode: root.barHidden ? ExclusionMode.Ignore : ExclusionMode.Auto

Copilot AI review requested due to automatic review settings August 10, 2026 11:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (1)

shell/plugins/bar/Bar.qml:965

  • Keeping the layer surface mapped also keeps its child popups mapped. An open PopupCard (for example the media or tray popup) is positioned one bar-width inward from this window, so shifting the parent by exactly barSize leaves the popup visibly parked at the screen edge instead of hiding it; its focus grab can remain active as well. Close activePopout and clear the tooltip when barHidden becomes true, or explicitly gate those popup surfaces on barHidden.
    visible: !remapGuard.remapping
    exclusionMode: root.barHidden ? ExclusionMode.Ignore : ExclusionMode.Auto

Copilot AI review requested due to automatic review settings August 10, 2026 11:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (3)

shell/plugins/bar/Bar.qml:964

  • Keeping BarPanel mapped also keeps its popup anchors valid. For example, PopupCard.visible depends only on open, and the tray's manage popup remains open until explicitly closed; there is no barHidden handler to close activePopout. Hiding the bar while such a popup is open can therefore leave the popup visible after the bar has parked. Clear the tooltip and close the active popout when barHidden becomes true.
    visible: !remapGuard.remapping

test/acceptance.d/session-test.sh:39

  • These two waits do not prove that the hidden bar is mapped and off-screen at the same time. omarchy-toggle-bar on only creates the flag, so the first wait can immediately observe the still-visible pre-update layer; after the asynchronous FileView update, layer_off_screen also succeeds when the namespace is completely absent. The old unmapping implementation can therefore pass this sequence. Poll a single snapshot that requires at least one matching layer and verifies that none of its boxes intersect its monitor.
wait_until "hidden bar layer stays mapped" 15 layer_present "omarchy-bar"
wait_until "hidden bar layer parks off screen" 15 layer_off_screen "omarchy-bar"

test/acceptance.d/base-test.sh:102

  • This overlap test accepts zero-area surfaces: for example, x=100, w=0 satisfies both horizontal comparisons, and the same applies to height. layer_on_screen can therefore report success before a layer has any drawable geometry. Require positive width and height before checking the intersection.
    | select(
        .x + .w > 0 and .x < $width and
        .y + .h > 0 and .y < $height
      )

@dhh
dhh merged commit 7633d8d into omacom:quattro Aug 10, 2026
nick1udwig pushed a commit to nick1udwig/omarchy that referenced this pull request Sep 9, 2026
)

* Keep the bar mapped while hidden so revealing it is instant

Hiding the bar set the panel invisible, which unmaps the layer surface and
releases the scene graph with it. Every reveal then had to rebuild all of
it: a new layer surface, a configure roundtrip, re-shaped glyphs and
re-uploaded textures, and a first frame before anything appeared.

Measured on a 2560x1440 screen, showing took 155-175ms against 20ms to
hide, and 400-595ms on the first reveal after a cold start. Splitting the
cost showed the exclusive-zone reflow was not to blame: show latency was
the same on an empty workspace as on a tiled one, and windows finished
moving ~15ms after the bar was already on screen.

Park the bar one bar-width past its anchored edge instead, and drop its
exclusion zone while hidden. The surface stays alive, so showing is only
a margin change: 10-14ms in both directions, at every bar position.

Since a hidden bar is now mapped, layer_present no longer proves the bar
is visible; the session acceptance test asserts on-screen geometry.

* Fix layer visibility checks on offset monitors

* Handle rotated outputs in layer visibility checks

* Cover hidden bar behavior in acceptance tests

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
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.

3 participants