Merge branch 'main' of github.com:ErikReider/SwayNotificationCenter

This commit is contained in:
Erik Reider 2022-05-13 14:15:52 +02:00
commit 17deb981cc
2 changed files with 10 additions and 2 deletions

View File

@ -186,8 +186,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);
}

View File

@ -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 ());