quickshell: fix worm never appearing (var array reassign emits no notify)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-08-04 09:37:16 +01:00
parent 4626e72219
commit 535fe56b76

View file

@ -872,7 +872,12 @@ in
let t = worm.trail; let t = worm.trail;
t.unshift(Qt.point(nx, ny)); t.unshift(Qt.point(nx, ny));
if (t.length > weird.segments * weird.lag) t.pop(); if (t.length > weird.segments * weird.lag) t.pop();
worm.trail = t; // reassign: arrays don't notify on mutation // slice(), not `t`: a var property assigned the array
// it already holds emits no change signal, so the
// segments would bind once to an empty trail and never
// hear about a single tick. Copy = new reference =
// notification. 30 short arrays a second is nothing.
worm.trail = t.slice();
} }
} }