summaryrefslogtreecommitdiff
path: root/src/daemon/daemon.c
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2026-03-21 10:14:28 -0400
committerVictor Kareh <[email protected]>2026-03-22 17:33:59 -0400
commit1f59db9705b487f6bbb3f64284c728b486a2a8e9 (patch)
tree45598db049b4bcefc99893d7ab105e31fbdb2a4e /src/daemon/daemon.c
parent8f19a38a5af8c25cad119efa8c8343d160299daa (diff)
downloadmate-notification-daemon-fix-critical-show-conditions.tar.bz2
mate-notification-daemon-fix-critical-show-conditions.tar.xz
daemon: Add force-display setting to override notification suppressionfix-critical-show-conditions
Add a new 'force-display' gsettings and checkbox that, when enabled, shows all notifications regardless of urgency, fullscreen, or screensaver state. Do Not Disturb still takes precedence. Fixes #199
Diffstat (limited to 'src/daemon/daemon.c')
-rw-r--r--src/daemon/daemon.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index 4f1aa11..3cdd72d 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -1834,8 +1834,10 @@ static gboolean notify_daemon_notify_handler(NotifyDaemonNotifications *object,
#endif /* HAVE_X11 */
/* fullscreen_window is assumed to be false on Wayland, as there is no trivial way to check */
+ gboolean force_display = g_settings_get_boolean (daemon->gsettings, GSETTINGS_KEY_FORCE_DISPLAY);
+
/* If on DnD or screensaver, suppress and close notification */
- if (do_not_disturb || (screensaver_active (GTK_WIDGET (nw)) && urgency != URGENCY_CRITICAL))
+ if (do_not_disturb || (!force_display && screensaver_active (GTK_WIDGET (nw)) && urgency != URGENCY_CRITICAL))
{
_NotifyPendingClose *notification_data;
@@ -1848,12 +1850,12 @@ static gboolean notify_daemon_notify_handler(NotifyDaemonNotifications *object,
}
else
{
- /* Show if critical or no fullscreen window */
- if (urgency == URGENCY_CRITICAL || !fullscreen_window)
+ /* Show if critical, force-display, or no fullscreen window */
+ if (force_display || urgency == URGENCY_CRITICAL || !fullscreen_window)
theme_show_notification (nw);
- /* Play sound unless low urgency during fullscreen */
- if (sound_file != NULL && !(fullscreen_window && urgency == URGENCY_LOW))
+ /* Play sound unless low urgency during fullscreen (when not force-display) */
+ if (sound_file != NULL && (force_display || !(fullscreen_window && urgency == URGENCY_LOW)))
sound_play_file (GTK_WIDGET (nw), sound_file);
}