mirror of
https://github.com/ErikReider/SwayNotificationCenter.git
synced 2024-11-25 06:27:08 +03:00
Do not keep transient notifications in the CC (#121)
Fixes #120. Notifications can indicate in their hints that they should be transient. A transient notification is not persistent, therefore, respects this hint and do not stack transient notifications in the control center.
This commit is contained in:
parent
50d2274f60
commit
07f6aac047
@ -182,8 +182,8 @@ namespace SwayNotificationCenter {
|
||||
noti_window.add_notification (param, this);
|
||||
}
|
||||
}
|
||||
// Only add notification to CC if it isn't IGNORED
|
||||
if (state != NotificationStatusEnum.IGNORED) {
|
||||
// Only add notification to CC if it isn't IGNORED and not transient
|
||||
if (state != NotificationStatusEnum.IGNORED && !param.transient) {
|
||||
control_center.add_notification (param, this);
|
||||
}
|
||||
|
||||
|
@ -83,6 +83,7 @@ namespace SwayNotificationCenter {
|
||||
public string desktop_entry { get; set; }
|
||||
public string category { get; set; }
|
||||
public bool resident { get; set; }
|
||||
public bool transient { get; set; }
|
||||
public UrgencyLevels urgency { get; set; }
|
||||
/** Replaces the old notification with the same value of:
|
||||
* - x-canonical-private-synchronous
|
||||
@ -226,6 +227,13 @@ namespace SwayNotificationCenter {
|
||||
resident = hint_value.get_boolean ();
|
||||
}
|
||||
break;
|
||||
case "transient":
|
||||
if (hint_value.is_of_type (GLib.VariantType.BOOLEAN)) {
|
||||
transient = hint_value.get_boolean ();
|
||||
} else if (hint_value.is_of_type (GLib.VariantType.INT32)) {
|
||||
transient = hint_value.get_int32 () == 1;
|
||||
}
|
||||
break;
|
||||
case "urgency":
|
||||
if (hint_value.is_of_type (GLib.VariantType.BYTE)) {
|
||||
urgency = UrgencyLevels.from_value (hint_value.get_byte ());
|
||||
|
Loading…
Reference in New Issue
Block a user