diff --git a/hancore.shibumi.status/BarWidget.qml b/hancore.shibumi.status/BarWidget.qml index 7c02acd..89bfb5d 100644 --- a/hancore.shibumi.status/BarWidget.qml +++ b/hancore.shibumi.status/BarWidget.qml @@ -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 diff --git a/tests/status-plugin-regression.sh b/tests/status-plugin-regression.sh index ebed578..7794cc9 100755 --- a/tests/status-plugin-regression.sh +++ b/tests/status-plugin-regression.sh @@ -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' \