quickshell: cap tracked notifications at 30

This commit is contained in:
rope 2026-08-19 12:10:37 +01:00
parent 2b967529b2
commit d831fc82f2

View file

@ -1748,6 +1748,14 @@ in
keepOnReload: true
onNotification: (notification) => {
notification.tracked = true;
// Tracked notifications are never expired, and the list
// renders through a Repeater every delegate is live,
// no view recycling. Left uncapped, a day's worth of
// notifications is a day's worth of retained image
// textures being repainted, which measurably starves
// games of the GPU. Drop the oldest past the cap.
const kept = [...(_notifServer.trackedNotifications.values)];
for (let i = 0; i < kept.length - 30; i++) kept[i].dismiss();
root.latestNotification = notification;
root.notificationReceived();
}