mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-02 02: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:
@@ -674,8 +674,10 @@ Rectangle {
|
|||||||
onEntered: parent.isHovered = true
|
onEntered: parent.isHovered = true
|
||||||
onExited: parent.isHovered = false
|
onExited: parent.isHovered = false
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (modelData && modelData.invoke)
|
if (modelData && modelData.invoke) {
|
||||||
modelData.invoke();
|
modelData.invoke();
|
||||||
|
PopoutService.closeNotificationCenter();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -813,6 +815,7 @@ Rectangle {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
if (modelData && modelData.invoke) {
|
if (modelData && modelData.invoke) {
|
||||||
modelData.invoke();
|
modelData.invoke();
|
||||||
|
PopoutService.closeNotificationCenter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ DankPopout {
|
|||||||
onDprChanged: updateStablePopupHeight()
|
onDprChanged: updateStablePopupHeight()
|
||||||
|
|
||||||
onShouldBeVisibleChanged: {
|
onShouldBeVisibleChanged: {
|
||||||
|
notificationHistoryVisible = shouldBeVisible;
|
||||||
|
|
||||||
if (shouldBeVisible) {
|
if (shouldBeVisible) {
|
||||||
NotificationService.onOverlayOpen();
|
NotificationService.onOverlayOpen();
|
||||||
updateStablePopupHeight();
|
updateStablePopupHeight();
|
||||||
|
|||||||
Reference in New Issue
Block a user