Skip to content

Fix: close notification center after clicking action buttons#2276

Merged
bbedward merged 2 commits intoAvengeMedia:masterfrom
nficca:fix/close-notification-center-on-action
Apr 27, 2026
Merged

Fix: close notification center after clicking action buttons#2276
bbedward merged 2 commits intoAvengeMedia:masterfrom
nficca:fix/close-notification-center-on-action

Conversation

@nficca
Copy link
Copy Markdown
Contributor

@nficca nficca commented Apr 26, 2026

Closes #2178

Close the notification center when clicking notification action buttons, matching the existing behavior of the popup toast, keyboard navigation (NotificationKeyboardController), and control center widgets. This lets the relevant app receive focus after the action is invoked, rather than being blocked by the layer-shell surface.

Also sync notificationHistoryVisible from onShouldBeVisibleChanged so that programmatic close() calls (like from PopoutService.closeNotificationCenter()) keep the property consistent. Without this, the bell toggle requires two presses to reopen after a programmatic close.

Before

before.mp4

After

after.mp4

nficca added 2 commits April 26, 2026 10:39
When clicking action buttons (e.g., "View", "Activate") in the
notification center, the action fires but the popout stays open. Since
the center is a layer-shell surface, it blocks focus changes on Wayland
compositors like niri, making the action appear to do nothing.

The keyboard navigation path already closes the center after invoking
actions; this brings the mouse click path in line.

Also fix closeNotificationCenter() in PopoutService to set
notificationHistoryVisible = false (matching PopoutManager._closePopout)
instead of calling close() directly, which left the visibility property
stale and caused the bell toggle to require two presses to reopen.

Fixes AvengeMedia#2178
NotificationCenterPopout has its own notificationHistoryVisible property
that drives open/close, but the PopoutService public API (open, close,
toggle) calls DankPopout methods directly, bypassing that property. This
leaves notificationHistoryVisible stale, causing the bell toggle to
require two presses to reopen after a programmatic close.

Sync the property from onShouldBeVisibleChanged so any caller going
through open()/close() gets the state corrected automatically.
@nficca nficca marked this pull request as ready for review April 26, 2026 15:25
@nficca nficca changed the title Close notification center after clicking action buttons Fix: close notification center after clicking action buttons Apr 26, 2026
@kanghengliu
Copy link
Copy Markdown
Contributor

how does this handle the 'dismiss' button? Normally you wouldn't want to dismiss the whole inbox when clicking 'dismiss' on a single notification.

@bbedward
Copy link
Copy Markdown
Collaborator

@kanghengliu dismiss button doesnt close the center, so good there.

@bbedward bbedward merged commit e805f6b into AvengeMedia:master Apr 27, 2026
1 check passed
@nficca nficca deleted the fix/close-notification-center-on-action branch April 27, 2026 13:56
bbedward pushed a commit that referenced this pull request Apr 28, 2026
* Close notification center after clicking action buttons

When clicking action buttons (e.g., "View", "Activate") in the
notification center, the action fires but the popout stays open. Since
the center is a layer-shell surface, it blocks focus changes on Wayland
compositors like niri, making the action appear to do nothing.

The keyboard navigation path already closes the center after invoking
actions; this brings the mouse click path in line.

Also fix closeNotificationCenter() in PopoutService to set
notificationHistoryVisible = false (matching PopoutManager._closePopout)
instead of calling close() directly, which left the visibility property
stale and caused the bell toggle to require two presses to reopen.

Fixes #2178

* Sync notificationHistoryVisible with shouldBeVisible

NotificationCenterPopout has its own notificationHistoryVisible property
that drives open/close, but the PopoutService public API (open, close,
toggle) calls DankPopout methods directly, bypassing that property. This
leaves notificationHistoryVisible stale, causing the bell toggle to
require two presses to reopen after a programmatic close.

Sync the property from onShouldBeVisibleChanged so any caller going
through open()/close() gets the state corrected automatically.
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.

Close notification center after clicking notification button

3 participants