Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion hancore.shibumi.status/BarWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,25 @@ Item {
property real spacingSavings: 0
property bool savingsPending: false
property bool spacingActive: false
property real spacingSavingsLeft: -1
property double spacingSavingsChangedAt: 0
// Settle after layout: binding width directly to snapped ink feeds the
// parent's new position back into its own reservation.
function syncSpacingSavings() {
if (!root || !spacingActive) return
const saved = Math.max(0, updateShift - bellShift)
savingsPending = false
if (Math.abs(spacingSavings - saved) > 1e-7) spacingSavings = saved
if (Math.abs(spacingSavings - saved) <= 1e-7) return
// Deferring alone does not settle it: a centered compact shell moves with
// its own width, and at fractional scales (1.25x) that move flips the
// snapped ink edges straight back, resizing the bar every frame. Ignore an
// immediate return to the value just left.
const now = Date.now()
if (Math.abs(saved - spacingSavingsLeft) <= 1e-7
&& now - spacingSavingsChangedAt < 500) return
spacingSavingsLeft = spacingSavings
spacingSavingsChangedAt = now
spacingSavings = saved
}
function scheduleSpacingSavings() {
savingsPending = true
Expand Down
3 changes: 3 additions & 0 deletions tests/status-plugin-regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ if ('else if (lifecycleBar && "tearingDown" in lifecycleBar\n'
raise SystemExit("Status no longer handles WidgetSlot's pre-destruction Bar revoke")
PY
printf 'status teardown ordering source guard passed\n'
rg -U -q 'Math\.abs\(saved - spacingSavingsLeft\) <= 1e-7\n[[:space:]]*&& now - spacingSavingsChangedAt < 500\) return' \
"$status_widget" \
|| fail "status spacing savings no longer settle a self-induced width cycle"
rg -Fq '["full", "icon", "text"]' "$status_widget" \
|| fail "status widget does not expose Full/Icon/Text display modes"
if rg -q 'SystemTray\.items|NotificationServer|makoctl|pgrep -x hypridle' \
Expand Down