From 2dd24f923f4d4f2bbc77314445a6b1b6701b3569 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Fri, 29 Aug 2025 09:14:41 -0400 Subject: history: Add enable/disable toggle This helps a bit with privacy. By disabling history, it wipes all notifications in the D-Bus buffer and prevents further storage. The history popup is also disabled. Notification storage resumes when history is enabled. Note that this just prevents the mate-notifications-daemon from storing notifications, but it doesn't prevent other processes from capturing them elsewhere. --- src/capplet/mate-notification-applet-history.c | 6 ++++++ src/capplet/mate-notification-properties.c | 3 +++ src/capplet/mate-notification-properties.ui | 16 ++++++++++++++++ 3 files changed, 25 insertions(+) (limited to 'src/capplet') diff --git a/src/capplet/mate-notification-applet-history.c b/src/capplet/mate-notification-applet-history.c index cca03d6..ce38a6f 100644 --- a/src/capplet/mate-notification-applet-history.c +++ b/src/capplet/mate-notification-applet-history.c @@ -245,6 +245,12 @@ show_notification_history (MateNotificationHistoryContext *context) return; } + /* Check if history is enabled */ + if (context->settings && !g_settings_get_boolean (context->settings, GSETTINGS_KEY_HISTORY_ENABLED)) { + g_warning ("Cannot show history: history is disabled for privacy"); + return; + } + /* If popup already exists, destroy it (basically toggle off) */ if (context->history_popup) { gtk_widget_destroy (context->history_popup); diff --git a/src/capplet/mate-notification-properties.c b/src/capplet/mate-notification-properties.c index adbbb6b..f81dd2c 100644 --- a/src/capplet/mate-notification-properties.c +++ b/src/capplet/mate-notification-properties.c @@ -44,6 +44,7 @@ typedef struct { GtkWidget* preview_button; GtkWidget* active_checkbox; GtkWidget* dnd_checkbox; + GtkWidget* history_checkbox; GtkWidget* monitor_label; GtkWidget* timeout_spin; GtkWidget* persistence_checkbox; @@ -496,6 +497,7 @@ static gboolean notification_properties_dialog_init(NotificationAppletDialog* di dialog->theme_combo = GTK_WIDGET(gtk_builder_get_object(builder, "theme_combo")); dialog->active_checkbox = GTK_WIDGET(gtk_builder_get_object(builder, "use_active_check")); dialog->dnd_checkbox = GTK_WIDGET(gtk_builder_get_object(builder, "do_not_disturb_check")); + dialog->history_checkbox = GTK_WIDGET(gtk_builder_get_object(builder, "history_enabled_check")); dialog->monitor_label = GTK_WIDGET(gtk_builder_get_object(builder, "monitor_label")); dialog->timeout_spin = GTK_WIDGET(gtk_builder_get_object(builder, "timeout_spin")); dialog->persistence_checkbox = GTK_WIDGET(gtk_builder_get_object(builder, "enable_persistence_check")); @@ -510,6 +512,7 @@ static gboolean notification_properties_dialog_init(NotificationAppletDialog* di g_settings_bind (dialog->gsettings, GSETTINGS_KEY_USE_ACTIVE_MONITOR, dialog->active_checkbox, "active", G_SETTINGS_BIND_DEFAULT); g_settings_bind (dialog->gsettings, GSETTINGS_KEY_DO_NOT_DISTURB, dialog->dnd_checkbox, "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (dialog->gsettings, GSETTINGS_KEY_HISTORY_ENABLED, dialog->history_checkbox, "active", G_SETTINGS_BIND_DEFAULT); GtkAdjustment *timeout_adjustment = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(dialog->timeout_spin)); g_settings_bind (dialog->gsettings, GSETTINGS_KEY_DEFAULT_TIMEOUT, timeout_adjustment, "value", G_SETTINGS_BIND_DEFAULT); diff --git a/src/capplet/mate-notification-properties.ui b/src/capplet/mate-notification-properties.ui index 49bc4c8..9b461bf 100644 --- a/src/capplet/mate-notification-properties.ui +++ b/src/capplet/mate-notification-properties.ui @@ -218,6 +218,22 @@ 2 + + + Enable Notification History + True + True + False + start + True + When enabled, notifications are stored for later viewing. When disabled, no notification history is kept for privacy. Note: This only controls MATE's notification storage; system logs may still contain notification data. + + + False + True + 3 + + -- cgit v1.2.1