From e805f6b5acef0ca26ffee42db2ddea26424a81af Mon Sep 17 00:00:00 2001 From: Nic Ficca Date: Mon, 27 Apr 2026 09:48:36 -0400 Subject: [PATCH] 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. --- quickshell/Modules/Notifications/Center/NotificationCard.qml | 5 ++++- .../Notifications/Center/NotificationCenterPopout.qml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/quickshell/Modules/Notifications/Center/NotificationCard.qml b/quickshell/Modules/Notifications/Center/NotificationCard.qml index 46194679..c20db57a 100644 --- a/quickshell/Modules/Notifications/Center/NotificationCard.qml +++ b/quickshell/Modules/Notifications/Center/NotificationCard.qml @@ -727,8 +727,10 @@ Rectangle { onEntered: parent.isHovered = true onExited: parent.isHovered = false onClicked: { - if (modelData && modelData.invoke) + if (modelData && modelData.invoke) { modelData.invoke(); + PopoutService.closeNotificationCenter(); + } } } } @@ -866,6 +868,7 @@ Rectangle { onClicked: { if (modelData && modelData.invoke) { modelData.invoke(); + PopoutService.closeNotificationCenter(); } } } diff --git a/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml b/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml index b7b616b8..809d0446 100644 --- a/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml +++ b/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml @@ -137,6 +137,8 @@ DankPopout { onDprChanged: updateStablePopupHeight() onShouldBeVisibleChanged: { + notificationHistoryVisible = shouldBeVisible; + if (shouldBeVisible) { NotificationService.onOverlayOpen(); updateStablePopupHeight();