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
@@ -27,8 +27,8 @@ Item {
|
||||
// diagnostics; the built-in bar does not otherwise need it.
|
||||
property var manifest: null
|
||||
// Mirrors the on-disk `bar-off` flag so the user can hide the bar without
|
||||
// killing the entire shell. Wired to BarPanel.visible below; updated by the
|
||||
// FileView watcher further down.
|
||||
// killing the entire shell. Hidden panels stay mapped but park off-screen
|
||||
// without an exclusion zone; updated by the FileView watcher further down.
|
||||
property bool barHidden: false
|
||||
property string home: Quickshell.env("HOME")
|
||||
property string stateHome: home + "/.local/state"
|
||||
@@ -956,13 +956,26 @@ Item {
|
||||
component BarPanel: PanelWindow {
|
||||
id: barWindow
|
||||
|
||||
visible: !root.barHidden && !remapGuard.remapping
|
||||
// Hiding parks the bar just past its screen edge instead of unmapping it.
|
||||
// Unmapping frees the layer surface and the whole scene graph, so every
|
||||
// reveal has to rebuild them — new surface, re-shaped glyphs, re-uploaded
|
||||
// textures — which measures ~150ms against ~20ms to tear down. Parking
|
||||
// keeps the surface alive, so showing is only a margin change.
|
||||
visible: !remapGuard.remapping
|
||||
exclusionMode: root.barHidden ? ExclusionMode.Ignore : ExclusionMode.Auto
|
||||
|
||||
ScreenMoveRemap {
|
||||
id: remapGuard
|
||||
window: barWindow
|
||||
}
|
||||
|
||||
margins {
|
||||
top: root.barHidden && root.position === "top" ? -root.barSize : 0
|
||||
bottom: root.barHidden && root.position === "bottom" ? -root.barSize : 0
|
||||
left: root.barHidden && root.position === "left" ? -root.barSize : 0
|
||||
right: root.barHidden && root.position === "right" ? -root.barSize : 0
|
||||
}
|
||||
|
||||
anchors {
|
||||
top: root.position === "top" || root.vertical
|
||||
bottom: root.position === "bottom" || root.vertical
|
||||
|
||||
Reference in New Issue
Block a user