Show notification on all screens when 0 screens are found

This commit is contained in:
Thibault Martin
2026-03-05 13:51:18 +01:00
parent d2ed3a11df
commit f0fd7a5631
+9 -2
View File
@@ -11,8 +11,15 @@ import qs.Widgets
// Simple notification popup - displays multiple notifications
Variants {
// If no notification display activated in settings, then show them all
model: Quickshell.screens.filter(screen => (Settings.data.notifications.monitors.includes(screen.name) || (Settings.data.notifications.monitors.length === 0)))
model: {
const screens = Quickshell.screens.filter(screen => Settings.data.notifications.monitors.includes(screen.name));
// Empty list can mean two things :
// - No (visible) notification display activated in settings
// - One or more (not visible) displays are activated but unplugged
// In both cases we fallback to show notification on all screens
return screens.length === 0 ? Quickshell.screens : screens;
}
delegate: Loader {
id: root