Repository navigation
Keep the bar mapped while hidden so revealing it is instant - #6677
Conversation
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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/heightin the untransformed orientation, while layer boxes use transformed logical coordinates; this repository already swaps them for transforms 1 and 3 inbin/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
barHiddenproperty documentation atBar.qml:29-31stale: it still says the flag is wired toBarPanel.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
There was a problem hiding this comment.
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 exactlybarSizeleaves the popup visibly parked at the screen edge instead of hiding it; its focus grab can remain active as well. CloseactivePopoutand clear the tooltip whenbarHiddenbecomes true, or explicitly gate those popup surfaces onbarHidden.
visible: !remapGuard.remapping
exclusionMode: root.barHidden ? ExclusionMode.Ignore : ExclusionMode.Auto
There was a problem hiding this comment.
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
BarPanelmapped also keeps its popup anchors valid. For example,PopupCard.visibledepends only onopen, and the tray's manage popup remains open until explicitly closed; there is nobarHiddenhandler to closeactivePopout. 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 whenbarHiddenbecomes 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 ononly creates the flag, so the first wait can immediately observe the still-visible pre-update layer; after the asynchronous FileView update,layer_off_screenalso 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=0satisfies both horizontal comparisons, and the same applies to height.layer_on_screencan 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
)
) * 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>
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 layersfor theomarchy-barsurface:The first reveal after a cold start measured 400-595ms.
Cause
BarPanelboundvisibleto!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.
barHiddenkeeps its meaning, so theomarchy-toggle-barflag contract and the notification anchoring that reads it are untouched. No animation was added, sincedefault/hypr/apps/omarchy-shell.luasetsno_animon 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):
grimscreenshotsBecause a hidden bar is now mapped,
layer_presentno longer proves the bar is visible, sosession-test.shasserts on-screen geometry through a newlayer_on_screenhelper. 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.