mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-30 01:22:06 -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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,6 +137,8 @@ DankPopout {
|
||||
onDprChanged: updateStablePopupHeight()
|
||||
|
||||
onShouldBeVisibleChanged: {
|
||||
notificationHistoryVisible = shouldBeVisible;
|
||||
|
||||
if (shouldBeVisible) {
|
||||
NotificationService.onOverlayOpen();
|
||||
updateStablePopupHeight();
|
||||
|
||||
Reference in New Issue
Block a user