1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-30 09:32:05 -04:00

Fix: close notification center after clicking action buttons (#2276)

* 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.
This commit is contained in:
Nic Ficca
2026-04-27 09:48:36 -04:00
committed by bbedward
parent 7412fee590
commit 07460dc3b7
2 changed files with 6 additions and 1 deletions

View File

@@ -674,8 +674,10 @@ Rectangle {
onEntered: parent.isHovered = true
onExited: parent.isHovered = false
onClicked: {
if (modelData && modelData.invoke)
if (modelData && modelData.invoke) {
modelData.invoke();
PopoutService.closeNotificationCenter();
}
}
}
}
@@ -813,6 +815,7 @@ Rectangle {
onClicked: {
if (modelData && modelData.invoke) {
modelData.invoke();
PopoutService.closeNotificationCenter();
}
}
}

View File

@@ -97,6 +97,8 @@ DankPopout {
onDprChanged: updateStablePopupHeight()
onShouldBeVisibleChanged: {
notificationHistoryVisible = shouldBeVisible;
if (shouldBeVisible) {
NotificationService.onOverlayOpen();
updateStablePopupHeight();