Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions data/io.elementary.wingpanel.notifications.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@
<summary>The expanded state of the headers</summary>
<description>The expanded state of the headers</description>
</key>
<key name="keep-notifications" type="b">
<default>true</default>
<summary>Whether to keep notifications</summary>
<description>Whether notifications are saved to persist accross reboots</description>
</key>
</schema>
</schemalist>
8 changes: 7 additions & 1 deletion src/Widgets/NotificationsList.vala
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public class Notifications.NotificationsList : Gtk.Bin {

private Gtk.ListBox listbox;

private static Settings settings;

static construct {
settings = new Settings ("io.elementary.wingpanel.notifications");
}

construct {
app_entries = new Gee.HashMap<string, AppEntry> ();
table = new HashTable<string, int> (str_hash, str_equal);
Expand Down Expand Up @@ -86,7 +92,7 @@ public class Notifications.NotificationsList : Gtk.Bin {
Idle.add (add_entry.callback);
yield;

if (add_to_session) { // If notification was obtained from session do not write it back
if (add_to_session && settings.get_boolean ("keep-notifications")) { // If notification was obtained from session do not write it back
Session.get_instance ().add_notification (notification);
}

Expand Down