Codebase list gnome-shell-extension-appindicator / f8c439f
statusNotifierWatcher: use the unique name for registering indicators Otherwise an app could have different names registered, and we could end up in two indicators for the same content. Marco Trevisan (TreviƱo) 6 years ago
2 changed file(s) with 18 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
124124 bus_name = invocation.get_sender();
125125 obj_path = service;
126126 } else { // we hope it is a bus name
127 bus_name = Util.getUniqueBusNameSync(invocation.get_connection(), service);
127128 bus_name = service;
128129 obj_path = DEFAULT_ITEM_OBJECT_PATH;
129130 }
4444 //Logger.debug("While refreshing property "+property_name+": "+e)
4545 }
4646 })
47 }
48
49 const getUniqueBusNameSync = function(bus, name) {
50 if (name[0] == ':')
51 return name;
52
53 if (!bus)
54 bus = Gio.DBus.session;
55
56 let variant_name = new GLib.Variant("(s)", [name]);
57 let [unique] = bus.call_sync("org.freedesktop.DBus", "/", "org.freedesktop.DBus",
58 "GetNameOwner", variant_name, null,
59 Gio.DBusCallFlags.NONE, -1, null).deep_unpack();
60
61 Logger.debug("Unique name of "+name+" is "+unique);
62
63 return unique;
4764 }
4865
4966 const connectSmart3A = function(src, signal, handler) {