repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

notifications: honor resident, close on action unless set

e4a9f128f023ff024954fc1687cf72fb5a2a1a29

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Per freedesktop, invoking an action dismisses the notification unless it
declared the resident hint. The server now captures resident and, after a
server action (including default) is invoked, closes the notification
unless it is resident. Verified: a non-resident notification disappears on
action, a resident one stays.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Changed files (1)

+9 / −1 text lines

Diff layout

quickshell/nuguland/Notifications.qml

Modified

+9 / −1 text lines

105105 "actions": actions,
106106 // KDE/Plasma de-facto progress hint (int:value 0-100); -1 = absent.
107107 "value": Number(record.value !== undefined ? record.value : -1),
108 // resident: keep the notification after an action is invoked.
109 "resident": !!record.resident,
108110 "popup": !(dnd || popupInhibition),
109111 "closed": false,
110112 "read": false,
206208 "expireTimeout": notification.expireTimeout,
207209 "transient": notification.transient,
208210 "actions": notification.actions || [],
209 "value": hintValue(notification)
211 "value": hintValue(notification),
212 "resident": notification.resident
210213 });
211214 const eligible = toastEligible(row, dnd);
212215 // only retain the live native object if something will render it:
494497 "id": id,
495498 "actionId": action,
496499 "invoked": invoked,
500 "resident": !!n.resident,
497501 "route": "Notifications.qml",
498502 "nativeActionRoute": nativeActionRoute
499503 };
504 // freedesktop: invoking an action dismisses the notification
505 // unless it declared itself resident.
506 if (!n.resident)
507 closeNotification(n);
500508 }
501509 notifications = notifications.slice(0);
502510 return stateJson();