quickshell: cap tracked notifications at 30
This commit is contained in:
parent
2b967529b2
commit
d831fc82f2
1 changed files with 8 additions and 0 deletions
|
|
@ -1748,6 +1748,14 @@ in
|
||||||
keepOnReload: true
|
keepOnReload: true
|
||||||
onNotification: (notification) => {
|
onNotification: (notification) => {
|
||||||
notification.tracked = true;
|
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.latestNotification = notification;
|
||||||
root.notificationReceived();
|
root.notificationReceived();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue