Skip to content

Commit c6a6f37

Browse files
committed
fix(notifications): prevent non-critical expireTimeout=0 from persisting forever
Notifications with expire-timeout=0 (freedesktop spec: never expire) now only persist indefinitely when urgency is Critical. Non-critical notifications with expire-timeout=0 (e.g. YubiKey/pam_u2f touch prompts) fall back to the DMS per-urgency timeout instead of persisting until manually dismissed. Root cause: the timer interval honored appTimeout >= 0, treating expire-timeout=0 literally. Combined with _initWrapperPersistence marking timeoutMs===0 as persistent, these notifications were never auto-dismissed, never destroyed, and never removed from the queue. Fixes: YubiKey/pam_u2f touch notifications, and any other sender that uses expire-timeout=0 for non-critical notifications.
1 parent 71b1901 commit c6a6f37

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

quickshell/Services/NotificationService.qml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,8 +773,12 @@ Singleton {
773773
return 5000;
774774
// expireTimeout is in milliseconds; -1 defers to our settings.
775775
const appTimeout = wrapper.notification.expireTimeout;
776-
if (appTimeout >= 0)
776+
if (appTimeout > 0)
777777
return Math.round(appTimeout);
778+
// expire-timeout 0 means "never expire" per freedesktop spec.
779+
// Only honor for Critical urgency; non-Critical falls through to DMS timeout.
780+
if (appTimeout === 0 && wrapper.urgency === NotificationUrgency.Critical)
781+
return 0;
778782
switch (wrapper.urgency) {
779783
case NotificationUrgency.Low:
780784
return SettingsData.notificationTimeoutLow;

0 commit comments

Comments
 (0)