From d1000c6d613b4cd26bd9ab3d890c3dee295f86a8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 13 Feb 2015 12:47:47 -0600 Subject: Adding a test for notification servers coming on and off the bus, and fixing the code for it --- src/service.vala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/service.vala') diff --git a/src/service.vala b/src/service.vala index 7ab0c9c..0b03b6e 100644 --- a/src/service.vala +++ b/src/service.vala @@ -33,11 +33,11 @@ public class IndicatorSound.Service: Object { this.notification_proxy = new DBusProxy.for_bus_sync(GLib.BusType.SESSION, DBusProxyFlags.DO_NOT_LOAD_PROPERTIES | DBusProxyFlags.DO_NOT_CONNECT_SIGNALS | DBusProxyFlags.DO_NOT_AUTO_START, null, /* interface info */ - "org.freedesktop.DBus", - "/org/freedesktop/DBus", - "org.freedesktop.DBus", + "org.freedesktop.Notifications", + "/org/freedesktop/Notifications", + "org.freedesktop.Notifications", null); - this.notification_proxy.notify["g-name-owner"].connect ( () => { check_sync_notification = false; } ); + this.notification_proxy.notify["g-name-owner"].connect ( () => { debug("Notifications name owner changed"); check_sync_notification = false; } ); } catch (GLib.Error e) { error("Unable to build notification proxy: %s", e.message); } @@ -288,6 +288,7 @@ public class IndicatorSound.Service: Object { void update_sync_notification () { if (!check_sync_notification) { + support_sync_notification = false; List caps = Notify.get_server_caps (); if (caps.find_custom ("x-canonical-private-synchronous", strcmp) != null) { support_sync_notification = true; -- cgit v1.2.3