Skip to content

Commit c0eaca2

Browse files
committed
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
1 parent fe82061 commit c0eaca2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/notifd/proxy.vala

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ internal class AstalNotifd.DaemonProxy : Object {
4343
private List<ulong> ids = new List<ulong>();
4444

4545
public void stop() {
46-
if (ids.length() > 0) {
47-
foreach (var id in ids)
48-
SignalHandler.disconnect(proxy, id);
46+
foreach (var id in ids) {
47+
SignalHandler.disconnect(proxy, id);
4948
}
5049
}
5150

@@ -94,8 +93,15 @@ internal class AstalNotifd.DaemonProxy : Object {
9493
add_notification(id);
9594

9695
ids.append(proxy.prop_changed.connect((prop) => {
97-
if (prop == "ignore-timeout" || prop == "dont-disturb")
96+
if (prop == "dont-disturb") {
97+
proxy.set_cached_property("DontDisturb", null);
9898
notify_property(prop);
99+
}
100+
101+
if (prop == "ignore-timeout") {
102+
proxy.set_cached_property("IgnoreTimeout", null);
103+
notify_property(prop);
104+
}
99105
}));
100106

101107
ids.append(proxy.notified.connect((id, replaced) => {

0 commit comments

Comments
 (0)