quickshell: keep notification sound while popup open; opening popup dismisses toast

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-06-11 15:01:52 +01:00
parent 2fcbc6865e
commit 991f3734aa

View file

@ -1750,6 +1750,9 @@ in
function resetView() { function resetView() {
viewYear = clockText.now.getFullYear(); viewYear = clockText.now.getFullYear();
viewMonth = clockText.now.getMonth(); viewMonth = clockText.now.getMonth();
// Runs on every open: an on-screen toast is redundant
// once the notification list is visible.
if (toastItem.visible) toastItem.dismiss();
} }
function shiftMonth(d) { function shiftMonth(d) {
let m = viewMonth + d; let m = viewMonth + d;
@ -2293,11 +2296,17 @@ in
Connections { Connections {
target: bar.shellRoot target: bar.shellRoot
function onNotificationReceived() { function onNotificationReceived() {
// No toast while the calendar popup is open the if (!toastItem.isPrimary) return;
// notification list is already on screen there. let n = bar.shellRoot.latestNotification;
if (toastItem.isPrimary && !calPopup.visible) { // Popup open: the notification list is already on
toastItem.showToast(bar.shellRoot.latestNotification); // screen play the sound but skip the toast.
if (calPopup.visible) {
if (!toastItem.mutedApps.includes(n.appName)) {
notifSoundProc.running = true;
}
return;
} }
toastItem.showToast(n);
} }
} }