aboutsummaryrefslogtreecommitdiffstats
path: root/notifications
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-23 15:01:14 +0200
committerDanilo M. <danix@danix.xyz>2026-10-23 15:01:14 +0200
commit101c3e68aa18814dcc18a813958e1aa0f76bd7a7 (patch)
treebaa1d7082ae0385333c3ffe79d49871621b3e8d6 /notifications
parent231a7da0f9b4b8b007617fe12414c794f9374ee0 (diff)
downloadquickshell-101c3e68aa18814dcc18a813958e1aa0f76bd7a7.tar.gz
quickshell-101c3e68aa18814dcc18a813958e1aa0f76bd7a7.zip
notify: one "balloon on screen" check, NotifyConfig.shown
The desktop companion needs to know when a balloon is showing in her corner, and the rule lived inline in NotificationBalloon's visible binding. It moves to the shared library so both shells ask the same function: drawer, snooze, mute, DND, then expiry. Shared files do not hot-reload through their links: restart the notifications and desktop shells after pulling this. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'notifications')
-rw-r--r--notifications/NotificationBalloon.qml9
1 files changed, 2 insertions, 7 deletions
diff --git a/notifications/NotificationBalloon.qml b/notifications/NotificationBalloon.qml
index 6a674b8..b5af3ab 100644
--- a/notifications/NotificationBalloon.qml
+++ b/notifications/NotificationBalloon.qml
@@ -32,13 +32,8 @@ Rectangle {
// everything; a muted app and DND are config.json's call (DND passes
// critical unless dndPassCritical is off). The drawer still lists what
// was withheld, because a list the user opened is not an interruption.
- visible: {
- if (Notify.drawerOpen) return false;
- if (Notify.snoozeUntil > b.now) return false;
- if (NC.withheld(Notify.config, b.notification, Notify.dnd)) return false;
- if (b.notification.expires !== 0 && b.now >= b.notification.expires) return false;
- return true;
- }
+ visible: NC.shown(Notify.config, b.notification, Notify.dnd, Notify.drawerOpen,
+ Notify.snoozeUntil, b.now)
width: parent ? parent.width : 340
implicitHeight: texts.implicitHeight + 20 + (preview.visible ? preview.height + 8 : 0)