Keep the bar mapped while hidden so revealing it is instant (#6677)
* 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>
This commit is contained in:
co-authored by
David Heinemeier Hansson
parent
354c2f0060
commit
7633d8dee4
@@ -24,8 +24,25 @@ for plugin in \
|
||||
done
|
||||
|
||||
# The bar and background are actually on screen
|
||||
wait_until "bar layer is on screen" 30 layer_present "omarchy-bar"
|
||||
wait_until "background layer is on screen" 30 layer_present "omarchy-background"
|
||||
wait_until "bar layer is on screen" 30 layer_on_screen "omarchy-bar"
|
||||
wait_until "background layer is on screen" 30 layer_on_screen "omarchy-background"
|
||||
|
||||
# Hiding parks the bar off-screen without unmapping its layer surface, and
|
||||
# revealing brings that same surface back on-screen.
|
||||
restore_bar_visibility() {
|
||||
omarchy-toggle-bar off >/dev/null 2>&1 || true
|
||||
}
|
||||
trap restore_bar_visibility EXIT
|
||||
|
||||
omarchy-toggle-bar on
|
||||
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"
|
||||
screenshot "success-bar-hidden"
|
||||
|
||||
omarchy-toggle-bar off
|
||||
wait_until "revealed bar layer returns on screen" 15 layer_on_screen "omarchy-bar"
|
||||
screenshot "success-bar-revealed"
|
||||
trap - EXIT
|
||||
|
||||
# Audio stack is up
|
||||
wait_until "pipewire is running" 30 wpctl status
|
||||
|
||||
Reference in New Issue
Block a user