Skip to content

fix(notifications): dismiss popups when senders close notifications#2815

Merged
bbedward merged 1 commit into
AvengeMedia:masterfrom
atimofeev:fix/noncritical-expire-timeout-zero
Jul 10, 2026
Merged

fix(notifications): dismiss popups when senders close notifications#2815
bbedward merged 1 commit into
AvengeMedia:masterfrom
atimofeev:fix/noncritical-expire-timeout-zero

Conversation

@atimofeev

@atimofeev atimofeev commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

When a notification sender calls CloseNotification per the freedesktop spec (e.g. YubiKey touch prompts sending expire-timeout=0 then CloseNotification(id) after touch), the onDropped handler removed the wrapper from allWrappers and notifications arrays but never dismissed the visible popup. The popup remained on screen forever for non-critical notifications.

Root cause

NotifWrapper.conn.onDropped() removes the wrapper from tracking arrays but does not set popup=false. Since expire-timeout=0 persistent notifications never start a timer, no other code path dismisses them. The popup stays visible until manually dismissed or another popup replaces it.

Fix

Single-file change in NotificationService.qml: add wrapper.popup = false in onDropped() so the popup exits through the normal signal chain (onPopupChangedremoveFromVisibleNotifications).

This is minimal and does not:

  • Change expireTimeout semantics or timer interval logic
  • Touch queue management, persistence markers, or releaseWrapper
  • Add new settings or IPC

Diff

@@ -892,6 +888,11 @@ Singleton {
                     return;
                 }
 
+                // Dismiss visible popup when sender closes the notification
+                // (e.g. YubiKey sends CloseNotification after touch).
+                // Without this, expireTimeout=0 popups stay visible forever.
+                wrapper.popup = false;
+
                 const groupKey = getGroupKey(wrapper);

Verification

  • dbus-monitor capture confirms yubikey-touch-detector sends Notify(expire_timeout=0) then CloseNotification(id) after touch
  • Brace/bracket/paren balance: 255/255, 95/95, 567/567 ✓
  • No trailing whitespace, ends with newline

Related

When a sender calls CloseNotification (per freedesktop spec) for a
persistent notification (expire-timeout=0), the onDropped handler
removed the wrapper from internal arrays but did not dismiss the
visible popup. The popup remained on screen forever for non-critical
notifications like YubiKey touch prompts.

Set wrapper.popup=false in onDropped so the popup exits via the
normal signal chain. This is minimal; it does not change timeout
handling, queue management, or the isPersistent marker.

Also reverts the previous workaround that special-cased non-critical
expireTimeout=0 to use DMS timeout. Upstream spec-correct behavior
is to honor the sender timeout, and fix the dismissal bug instead.

Closes AvengeMedia#2814
@atimofeev atimofeev force-pushed the fix/noncritical-expire-timeout-zero branch from c6a6f37 to 1398dd2 Compare July 10, 2026 20:38
@atimofeev atimofeev changed the title fix(notifications): prevent non-critical expireTimeout=0 from persisting forever fix(notifications): dismiss popups when senders close notifications Jul 10, 2026
@bbedward bbedward merged commit 26b2955 into AvengeMedia:master Jul 10, 2026
1 check passed
Purian23 pushed a commit that referenced this pull request Jul 10, 2026
…2815)

When a sender calls CloseNotification (per freedesktop spec) for a
persistent notification (expire-timeout=0), the onDropped handler
removed the wrapper from internal arrays but did not dismiss the
visible popup. The popup remained on screen forever for non-critical
notifications like YubiKey touch prompts.

Set wrapper.popup=false in onDropped so the popup exits via the
normal signal chain. This is minimal; it does not change timeout
handling, queue management, or the isPersistent marker.

Also reverts the previous workaround that special-cased non-critical
expireTimeout=0 to use DMS timeout. Upstream spec-correct behavior
is to honor the sender timeout, and fix the dismissal bug instead.

Closes #2814

(cherry picked from commit 26b2955)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants