From c0eaca24dc7bc9f0091def5a37b14173e5bfd29e Mon Sep 17 00:00:00 2001 From: Aylur Date: Thu, 6 Feb 2025 14:47:02 +0100 Subject: fix(notifd): invalidate props from proxy this fixes dont-disturb and ignore-timeout getters from the proxy, currently the cached values were returned which were set at launch and never changed might be a better idea to use the PropertiesChanged interface instead --- lib/notifd/proxy.vala | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/notifd/proxy.vala b/lib/notifd/proxy.vala index 95e7105..ab0ae33 100644 --- a/lib/notifd/proxy.vala +++ b/lib/notifd/proxy.vala @@ -43,9 +43,8 @@ internal class AstalNotifd.DaemonProxy : Object { private List ids = new List(); public void stop() { - if (ids.length() > 0) { - foreach (var id in ids) - SignalHandler.disconnect(proxy, id); + foreach (var id in ids) { + SignalHandler.disconnect(proxy, id); } } @@ -94,8 +93,15 @@ internal class AstalNotifd.DaemonProxy : Object { add_notification(id); ids.append(proxy.prop_changed.connect((prop) => { - if (prop == "ignore-timeout" || prop == "dont-disturb") + if (prop == "dont-disturb") { + proxy.set_cached_property("DontDisturb", null); notify_property(prop); + } + + if (prop == "ignore-timeout") { + proxy.set_cached_property("IgnoreTimeout", null); + notify_property(prop); + } })); ids.append(proxy.notified.connect((id, replaced) => { -- cgit v1.2.3