Merge lp:~muktupavels/libappindicator/create-as-service into lp:libappindicator/15.10

Proposed by Alberts Muktupāvels
Status: Needs review
Proposed branch: lp:~muktupavels/libappindicator/create-as-service
Merge into: lp:libappindicator/15.10
Diff against target: 346 lines (+82/-76)
2 files modified
src/app-indicator.c (+80/-75)
src/dbus-shared.h (+2/-1)
To merge this branch: bzr merge lp:~muktupavels/libappindicator/create-as-service
Reviewer Review Type Date Requested Status
Ted Gould (community) Needs Information
Dmitry Shachnev Approve
Review via email: mp+263108@code.launchpad.net

Commit message

Follow spec more closely. "RegisterStatusNotifierItem" method on watcher should be called with dbus name/address not path.

Description of the change

Follow spec more closely. "RegisterStatusNotifierItem" method on watcher should be called with dbus name/address not path.

To post a comment you must log in.
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Unfortunately it fails to build because NOTIFICATION_ITEM_DBUS_OBJ is not defined:
http://mitya57.me/builds/libappindicator_12.10.1+15.04.20141110-0ubuntu2_amd64.build

review: Needs Fixing
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

> Unfortunately it fails to build because NOTIFICATION_ITEM_DBUS_OBJ is not
> defined:
> http://mitya57.me/builds/libappindicator_12.10.1+15.04.20141110-0ubuntu2_amd64
> .build

Previous commit was missing one file... I hope that now it builds.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Thanks! It builds now. I tested with remmina and transmission, everything seems to work as before.

review: Approve
Revision history for this message
Ted Gould (ted) wrote :

I'm a little confused, why do we want Items to register a name on the bus? I'm not sure what benefit that has, and it makes things more difficult when we start looking at application confinement where we're not allowing name registrations.

review: Needs Information
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

> I'm a little confused, why do we want Items to register a name on the bus? I'm

Because it is what spec says, no?

http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierWatcher/
"Register a StatusNotifierItem into the StatusNotifierWatcher, in the form of its full name on the session bus, for instance org.freedesktop.StatusNotifierItem-4077-1."

> not sure what benefit that has, and it makes things more difficult when we
> start looking at application confinement where we're not allowing name
> registrations.

For example it makes easier to watch when name (status notifier item) disappears from bus:
https://github.com/albertsmuktupavels/libstatus-notifier/blob/master/libstatus-notifier/sn-watcher.c#L117

Did not understand part about not allowing name registrations... :(

Revision history for this message
Ted Gould (ted) wrote :

On Tue, 2015-06-30 at 14:18 +0000, Alberts Muktupāvels wrote:

> > I'm a little confused, why do we want Items to register a name on the bus? I'm
>
> Because it is what spec says, no?
>
> http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierWatcher/
> "Register a StatusNotifierItem into the StatusNotifierWatcher, in the form of its full name on the session bus, for instance org.freedesktop.StatusNotifierItem-4077-1."

Ah, interesting. That's been added since we implemented the spec.

> > not sure what benefit that has, and it makes things more difficult when we
> > start looking at application confinement where we're not allowing name
> > registrations.
>
> For example it makes easier to watch when name (status notifier item) disappears from bus:
> https://github.com/albertsmuktupavels/libstatus-notifier/blob/master/libstatus-notifier/sn-watcher.c#L117

You can watch for when the connection drops off the bus as well. I don't
think there's a real difference between watching the name and the
connection.

> Did not understand part about not allowing name registrations... :(

For Ubuntu Personal and Ubuntu Phone we want to allow application
indicators in the convergence cases, but the confinement there doesn't
allow for name registrations on the dbus session bus.

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

> On Tue, 2015-06-30 at 14:18 +0000, Alberts Muktupāvels wrote:
>
> > > I'm a little confused, why do we want Items to register a name on the bus?
> I'm
> >
> > Because it is what spec says, no?
> >
> > http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNoti
> fierWatcher/
> > "Register a StatusNotifierItem into the StatusNotifierWatcher, in the form
> of its full name on the session bus, for instance
> org.freedesktop.StatusNotifierItem-4077-1."
>
>
> Ah, interesting. That's been added since we implemented the spec.

I don't like this spec, but I guess there is no better choice... Does that mean that they have changed spec when there was existing implementations?

> > > not sure what benefit that has, and it makes things more difficult when we
> > > start looking at application confinement where we're not allowing name
> > > registrations.
> >
> > For example it makes easier to watch when name (status notifier item)
> disappears from bus:
> > https://github.com/albertsmuktupavels/libstatus-notifier/blob/master
> /libstatus-notifier/sn-watcher.c#L117
>
>
>
> You can watch for when the connection drops off the bus as well. I don't
> think there's a real difference between watching the name and the
> connection.

That was just small example. Still I think it is better to follow spec not trying to support each possible implementation that is different from spec.

> > Did not understand part about not allowing name registrations... :(
>
>
> For Ubuntu Personal and Ubuntu Phone we want to allow application
> indicators in the convergence cases, but the confinement there doesn't
> allow for name registrations on the dbus session bus.

Is there a way to detect that application is running on Ubuntu Personal and/or Ubuntu Phone? Then I could update branch to register dbus name only if it is not running on Personal or Phone.

Revision history for this message
Ted Gould (ted) wrote :

On Wed, 2015-07-01 at 16:32 +0000, Alberts Muktupāvels wrote:

> I don't like this spec, but I guess there is no better choice... Does
> that mean that they have changed spec when there was existing
> implementations?

Yes, and I imagine that is why it is written as a "can" instead of a
"must" or even "should."

"Each application can register"

http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem/

> > You can watch for when the connection drops off the bus as well. I don't
> > think there's a real difference between watching the name and the
> > connection.
>
>
> That was just small example. Still I think it is better to follow spec
> not trying to support each possible implementation that is different
> from spec.

Since it is not a required part of the spec I think you should probably
support the more generic DBus mechanisms as well as parts of the spec
that you wish.

> > > Did not understand part about not allowing name registrations... :(
> >
> >
> > For Ubuntu Personal and Ubuntu Phone we want to allow application
> > indicators in the convergence cases, but the confinement there doesn't
> > allow for name registrations on the dbus session bus.
>
>
> Is there a way to detect that application is running on Ubuntu
> Personal and/or Ubuntu Phone? Then I could update branch to register
> dbus name only if it is not running on Personal or Phone.

I think what would perhaps be better is allow for the name registration
to fail, and handle that exception. There's no real reason to put the
name in the messages. Basically make it so that the name request is only
optional to have succeed.

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

> On Wed, 2015-07-01 at 16:32 +0000, Alberts Muktupāvels wrote:
>
> > I don't like this spec, but I guess there is no better choice... Does
> > that mean that they have changed spec when there was existing
> > implementations?
>
>
>
> Yes, and I imagine that is why it is written as a "can" instead of a
> "must" or even "should."
>
> "Each application can register"
>
> http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifi
> erItem/

I understand it like this:
Each application can register multiple items...

Next paragraph:
"As soon as a new instance of a StatusNotifierItem is created, the application must register the unique instance name to the StatusNotifierWatcher as described in the Section called StatusNotifierWatcher"

Is not unique name meant to be org.freedesktop.StatusNotifierItem-PID-ID?

RegisterStatusINotifierItem method:
"Register a StatusNotifierItem into the StatusNotifierWatcher, in the form of its full name on the session bus, for instance org.freedesktop.StatusNotifierItem-4077-1."

> > > You can watch for when the connection drops off the bus as well. I don't
> > > think there's a real difference between watching the name and the
> > > connection.
> >
> >
> > That was just small example. Still I think it is better to follow spec
> > not trying to support each possible implementation that is different
> > from spec.
>
>
>
> Since it is not a required part of the spec I think you should probably
> support the more generic DBus mechanisms as well as parts of the spec
> that you wish.

Well spec says exactly how item should be registered with watcher... I don't know how that spec looked in past - that is what I am reading right now.

> > > > Did not understand part about not allowing name registrations... :(
> > >
> > >
> > > For Ubuntu Personal and Ubuntu Phone we want to allow application
> > > indicators in the convergence cases, but the confinement there doesn't
> > > allow for name registrations on the dbus session bus.
> >
> >
> > Is there a way to detect that application is running on Ubuntu
> > Personal and/or Ubuntu Phone? Then I could update branch to register
> > dbus name only if it is not running on Personal or Phone.
>
>
> I think what would perhaps be better is allow for the name registration
> to fail, and handle that exception. There's no real reason to put the
> name in the messages. Basically make it so that the name request is only
> optional to have succeed.

https://developer.gnome.org/gio/stable/gio-Owning-Bus-Names.html#g-bus-own-name
That would be name_lost_handler with connection == NULL, right?

So, are you ok with this change? with adding fallback to old behaviour if name registration fails?

Revision history for this message
Ted Gould (ted) wrote :

On Wed, 2015-07-01 at 20:58 +0000, Alberts Muktupāvels wrote:

> I understand it like this:
> Each application can register multiple items...
>
> Next paragraph:
> "As soon as a new instance of a StatusNotifierItem is created, the application must register the unique instance name to the StatusNotifierWatcher as described in the Section called StatusNotifierWatcher"
>
> Is not unique name meant to be org.freedesktop.StatusNotifierItem-PID-ID?

No, it is not. A unique bus name is the name that DBus gives the
connection, for example :3.0. You can find a description of the various
bus names in the DBus spec:

http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-bus

There can only be one item per connection because even if you registered
for another name SNI hardcodes the object path, and you only get one of
those per connection. (something I'm not fond of in the spec, but eh)

> https://developer.gnome.org/gio/stable/gio-Owning-Bus-Names.html#g-bus-own-name
> That would be name_lost_handler with connection == NULL, right?

It would be a call to name_lost_handler, but the connection would be
valid as there was the ability to connect to the bus.

> So, are you ok with this change? with adding fallback to old behaviour if name registration fails?

Yes, as long as we don't have the requirement to get the name I'm find
with asking for it.

Unmerged revisions

275. By Alberts Muktupāvels

Fix build...

274. By Alberts Muktupāvels

Create StatusNotifierItem as service and use its name to register with watcher.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/app-indicator.c'
--- src/app-indicator.c 2014-11-10 09:14:07 +0000
+++ src/app-indicator.c 2015-06-27 17:40:16 +0000
@@ -67,7 +67,6 @@
67 /*< Private >*/67 /*< Private >*/
68 /* Properties */68 /* Properties */
69 gchar *id;69 gchar *id;
70 gchar *clean_id;
71 AppIndicatorCategory category;70 AppIndicatorCategory category;
72 AppIndicatorStatus status;71 AppIndicatorStatus status;
73 gchar *icon_name;72 gchar *icon_name;
@@ -91,8 +90,9 @@
91 /* Fun stuff */90 /* Fun stuff */
92 GDBusProxy *watcher_proxy;91 GDBusProxy *watcher_proxy;
93 GDBusConnection *connection;92 GDBusConnection *connection;
93 guint name_id;
94 guint dbus_registration;94 guint dbus_registration;
95 gchar * path;95 gchar * service;
9696
97 /* Might be used */97 /* Might be used */
98 IndicatorDesktopShortcuts * shorties;98 IndicatorDesktopShortcuts * shorties;
@@ -152,9 +152,6 @@
152#define APP_INDICATOR_GET_PRIVATE(o) \152#define APP_INDICATOR_GET_PRIVATE(o) \
153 (G_TYPE_INSTANCE_GET_PRIVATE ((o), APP_INDICATOR_TYPE, AppIndicatorPrivate))153 (G_TYPE_INSTANCE_GET_PRIVATE ((o), APP_INDICATOR_TYPE, AppIndicatorPrivate))
154154
155/* Default Path */
156#define DEFAULT_ITEM_PATH "/org/ayatana/NotificationItem"
157
158/* More constants */155/* More constants */
159#define DEFAULT_FALLBACK_TIMER 100 /* in milliseconds */156#define DEFAULT_FALLBACK_TIMER 100 /* in milliseconds */
160157
@@ -584,7 +581,6 @@
584 AppIndicatorPrivate * priv = APP_INDICATOR_GET_PRIVATE(self);581 AppIndicatorPrivate * priv = APP_INDICATOR_GET_PRIVATE(self);
585582
586 priv->id = NULL;583 priv->id = NULL;
587 priv->clean_id = NULL;
588 priv->category = APP_INDICATOR_CATEGORY_OTHER;584 priv->category = APP_INDICATOR_CATEGORY_OTHER;
589 priv->status = APP_INDICATOR_STATUS_PASSIVE;585 priv->status = APP_INDICATOR_STATUS_PASSIVE;
590 priv->icon_name = NULL;586 priv->icon_name = NULL;
@@ -600,8 +596,9 @@
600596
601 priv->watcher_proxy = NULL;597 priv->watcher_proxy = NULL;
602 priv->connection = NULL;598 priv->connection = NULL;
599 priv->name_id = 0;
603 priv->dbus_registration = 0;600 priv->dbus_registration = 0;
604 priv->path = NULL;601 priv->service = NULL;
605602
606 priv->status_icon = NULL;603 priv->status_icon = NULL;
607 priv->fallback_timer = 0;604 priv->fallback_timer = 0;
@@ -681,6 +678,11 @@
681 priv->dbus_registration = 0;678 priv->dbus_registration = 0;
682 }679 }
683680
681 if (priv->name_id != 0) {
682 g_bus_unown_name(priv->name_id);
683 priv->name_id = 0;
684 }
685
684 if (priv->connection != NULL) {686 if (priv->connection != NULL) {
685 g_object_unref(G_OBJECT(priv->connection));687 g_object_unref(G_OBJECT(priv->connection));
686 priv->connection = NULL;688 priv->connection = NULL;
@@ -715,11 +717,6 @@
715 priv->id = NULL;717 priv->id = NULL;
716 }718 }
717719
718 if (priv->clean_id != NULL) {
719 g_free(priv->clean_id);
720 priv->clean_id = NULL;
721 }
722
723 if (priv->icon_name != NULL) {720 if (priv->icon_name != NULL) {
724 g_free(priv->icon_name);721 g_free(priv->icon_name);
725 priv->icon_name = NULL;722 priv->icon_name = NULL;
@@ -760,9 +757,9 @@
760 priv->att_accessible_desc = NULL;757 priv->att_accessible_desc = NULL;
761 }758 }
762759
763 if (priv->path != NULL) {760 if (priv->service != NULL) {
764 g_free(priv->path);761 g_free(priv->service);
765 priv->path = NULL;762 priv->service = NULL;
766 }763 }
767764
768 G_OBJECT_CLASS (app_indicator_parent_class)->finalize (object);765 G_OBJECT_CLASS (app_indicator_parent_class)->finalize (object);
@@ -788,14 +785,6 @@
788785
789 priv->id = g_strdup (g_value_get_string (value));786 priv->id = g_strdup (g_value_get_string (value));
790787
791 priv->clean_id = g_strdup(priv->id);
792 gchar * cleaner;
793 for (cleaner = priv->clean_id; *cleaner != '\0'; cleaner++) {
794 if (!g_ascii_isalnum(*cleaner)) {
795 *cleaner = '_';
796 }
797 }
798
799 check_connect (self);788 check_connect (self);
800 break;789 break;
801790
@@ -881,8 +870,8 @@
881 GError * error = NULL;870 GError * error = NULL;
882871
883 g_dbus_connection_emit_signal(self->priv->connection,872 g_dbus_connection_emit_signal(self->priv->connection,
884 NULL,873 self->priv->service,
885 self->priv->path,874 NOTIFICATION_ITEM_DBUS_OBJ,
886 NOTIFICATION_ITEM_DBUS_IFACE,875 NOTIFICATION_ITEM_DBUS_IFACE,
887 "NewTitle",876 "NewTitle",
888 NULL,877 NULL,
@@ -1180,8 +1169,8 @@
1180 GError * error = NULL;1169 GError * error = NULL;
11811170
1182 g_dbus_connection_emit_signal(priv->connection,1171 g_dbus_connection_emit_signal(priv->connection,
1183 NULL,1172 priv->service,
1184 priv->path,1173 NOTIFICATION_ITEM_DBUS_OBJ,
1185 NOTIFICATION_ITEM_DBUS_IFACE,1174 NOTIFICATION_ITEM_DBUS_IFACE,
1186 "XAyatanaNewLabel",1175 "XAyatanaNewLabel",
1187 g_variant_new("(ss)", label, guide),1176 g_variant_new("(ss)", label, guide),
@@ -1214,48 +1203,25 @@
1214 return;1203 return;
1215}1204}
12161205
1217/* This function is used to see if we have enough information to
1218 connect to things. If we do, and we're not connected, it
1219 connects for us. */
1220static void1206static void
1221check_connect (AppIndicator *self)1207bus_acquired_handler (GDBusConnection *connection,
1208 const gchar *name,
1209 gpointer user_data)
1222{1210{
1211 AppIndicator *self = (AppIndicator *) user_data;
1223 AppIndicatorPrivate *priv = self->priv;1212 AppIndicatorPrivate *priv = self->priv;
12241213
1225 /* Do we have a connection? */
1226 if (priv->connection == NULL) return;
1227
1228 /* If we already have a proxy, let's see if it has someone
1229 implementing it. If not, we can't do much more than to
1230 do nothing. */
1231 if (priv->watcher_proxy != NULL) {
1232 gchar * name = g_dbus_proxy_get_name_owner(priv->watcher_proxy);
1233 if (name == NULL) {
1234 return;
1235 }
1236 g_free(name);
1237 }
1238
1239 /* Do we have enough information? */
1240 if (priv->menu == NULL) return;
1241 if (priv->icon_name == NULL) return;
1242 if (priv->id == NULL) return;
1243
1244 if (priv->path == NULL) {
1245 priv->path = g_strdup_printf(DEFAULT_ITEM_PATH "/%s", priv->clean_id);
1246 }
1247
1248 if (priv->dbus_registration == 0) {1214 if (priv->dbus_registration == 0) {
1249 GError * error = NULL;1215 GError * error = NULL;
1250 priv->dbus_registration = g_dbus_connection_register_object(priv->connection,1216 priv->dbus_registration = g_dbus_connection_register_object(priv->connection,
1251 priv->path,1217 NOTIFICATION_ITEM_DBUS_OBJ,
1252 item_interface_info,1218 item_interface_info,
1253 &item_interface_table,1219 &item_interface_table,
1254 self,1220 self,
1255 NULL,1221 NULL,
1256 &error);1222 &error);
1257 if (error != NULL) {1223 if (error != NULL) {
1258 g_warning("Unable to register object on path '%s': %s", priv->path, error->message);1224 g_warning("Unable to register object on path '%s': %s", NOTIFICATION_ITEM_DBUS_OBJ, error->message);
1259 g_error_free(error);1225 g_error_free(error);
1260 return;1226 return;
1261 }1227 }
@@ -1282,6 +1248,50 @@
1282 } else {1248 } else {
1283 bus_watcher_ready(NULL, NULL, self);1249 bus_watcher_ready(NULL, NULL, self);
1284 }1250 }
1251}
1252
1253/* This function is used to see if we have enough information to
1254 connect to things. If we do, and we're not connected, it
1255 connects for us. */
1256static void
1257check_connect (AppIndicator *self)
1258{
1259 AppIndicatorPrivate *priv = self->priv;
1260 static guint id = 0;
1261
1262 /* Do we have a connection? */
1263 if (priv->connection == NULL) return;
1264
1265 /* If we already have a proxy, let's see if it has someone
1266 implementing it. If not, we can't do much more than to
1267 do nothing. */
1268 if (priv->watcher_proxy != NULL) {
1269 gchar * name = g_dbus_proxy_get_name_owner(priv->watcher_proxy);
1270 if (name == NULL) {
1271 return;
1272 }
1273 g_free(name);
1274 }
1275
1276 /* Do we have enough information? */
1277 if (priv->menu == NULL) return;
1278 if (priv->icon_name == NULL) return;
1279 if (priv->id == NULL) return;
1280
1281 if (priv->service == NULL) {
1282 priv->service = g_strdup_printf(NOTIFICATION_ITEM_DBUS_ADDR "-%d-%d", getpid(), id++);
1283 }
1284
1285 if (priv->name_id == 0) {
1286 priv->name_id = g_bus_own_name (G_BUS_TYPE_SESSION,
1287 priv->service,
1288 G_BUS_NAME_OWNER_FLAGS_NONE,
1289 (GBusAcquiredCallback) bus_acquired_handler,
1290 NULL,
1291 NULL,
1292 self,
1293 NULL);
1294 }
12851295
1286 return;1296 return;
1287}1297}
@@ -1338,7 +1348,7 @@
13381348
1339 g_dbus_proxy_call(app->priv->watcher_proxy,1349 g_dbus_proxy_call(app->priv->watcher_proxy,
1340 "RegisterStatusNotifierItem",1350 "RegisterStatusNotifierItem",
1341 g_variant_new("(s)", app->priv->path),1351 g_variant_new("(s)", app->priv->service),
1342 G_DBUS_CALL_FLAGS_NONE,1352 G_DBUS_CALL_FLAGS_NONE,
1343 -1,1353 -1,
1344 NULL, /* cancelable */1354 NULL, /* cancelable */
@@ -1499,8 +1509,8 @@
1499 GError * error = NULL;1509 GError * error = NULL;
15001510
1501 g_dbus_connection_emit_signal(priv->connection,1511 g_dbus_connection_emit_signal(priv->connection,
1502 NULL,1512 priv->service,
1503 priv->path,1513 NOTIFICATION_ITEM_DBUS_OBJ,
1504 NOTIFICATION_ITEM_DBUS_IFACE,1514 NOTIFICATION_ITEM_DBUS_IFACE,
1505 "NewIcon",1515 "NewIcon",
1506 NULL,1516 NULL,
@@ -1837,8 +1847,8 @@
1837 GError * error = NULL;1847 GError * error = NULL;
18381848
1839 g_dbus_connection_emit_signal(self->priv->connection,1849 g_dbus_connection_emit_signal(self->priv->connection,
1840 NULL,1850 self->priv->service,
1841 self->priv->path,1851 NOTIFICATION_ITEM_DBUS_OBJ,
1842 NOTIFICATION_ITEM_DBUS_IFACE,1852 NOTIFICATION_ITEM_DBUS_IFACE,
1843 "NewStatus",1853 "NewStatus",
1844 g_variant_new("(s)", value->value_nick),1854 g_variant_new("(s)", value->value_nick),
@@ -1904,8 +1914,8 @@
1904 GError * error = NULL;1914 GError * error = NULL;
19051915
1906 g_dbus_connection_emit_signal(self->priv->connection,1916 g_dbus_connection_emit_signal(self->priv->connection,
1907 NULL,1917 self->priv->service,
1908 self->priv->path,1918 NOTIFICATION_ITEM_DBUS_OBJ,
1909 NOTIFICATION_ITEM_DBUS_IFACE,1919 NOTIFICATION_ITEM_DBUS_IFACE,
1910 "NewAttentionIcon",1920 "NewAttentionIcon",
1911 NULL,1921 NULL,
@@ -1982,8 +1992,8 @@
1982 GError * error = NULL;1992 GError * error = NULL;
19831993
1984 g_dbus_connection_emit_signal(self->priv->connection,1994 g_dbus_connection_emit_signal(self->priv->connection,
1985 NULL,1995 self->priv->service,
1986 self->priv->path,1996 NOTIFICATION_ITEM_DBUS_OBJ,
1987 NOTIFICATION_ITEM_DBUS_IFACE,1997 NOTIFICATION_ITEM_DBUS_IFACE,
1988 "NewIcon",1998 "NewIcon",
1989 NULL,1999 NULL,
@@ -2048,8 +2058,8 @@
2048 GError * error = NULL;2058 GError * error = NULL;
20492059
2050 g_dbus_connection_emit_signal(self->priv->connection,2060 g_dbus_connection_emit_signal(self->priv->connection,
2051 NULL,2061 self->priv->service,
2052 self->priv->path,2062 NOTIFICATION_ITEM_DBUS_OBJ,
2053 NOTIFICATION_ITEM_DBUS_IFACE,2063 NOTIFICATION_ITEM_DBUS_IFACE,
2054 "NewIconThemePath",2064 "NewIconThemePath",
2055 g_variant_new("(s)", self->priv->icon_theme_path),2065 g_variant_new("(s)", self->priv->icon_theme_path),
@@ -2081,9 +2091,7 @@
2081 }2091 }
20822092
2083 if (priv->menuservice == NULL) {2093 if (priv->menuservice == NULL) {
2084 gchar * path = g_strdup_printf(DEFAULT_ITEM_PATH "/%s/Menu", priv->clean_id);2094 priv->menuservice = dbusmenu_server_new (NOTIFICATION_ITEM_DBUS_OBJ "/Menu");
2085 priv->menuservice = dbusmenu_server_new (path);
2086 g_free(path);
2087 }2095 }
20882096
2089 dbusmenu_server_set_root (priv->menuservice, root);2097 dbusmenu_server_set_root (priv->menuservice, root);
@@ -2114,7 +2122,6 @@
21142122
2115 g_return_if_fail (IS_APP_INDICATOR (self));2123 g_return_if_fail (IS_APP_INDICATOR (self));
2116 g_return_if_fail (GTK_IS_MENU (menu));2124 g_return_if_fail (GTK_IS_MENU (menu));
2117 g_return_if_fail (self->priv->clean_id != NULL);
21182125
2119 priv = self->priv;2126 priv = self->priv;
21202127
@@ -2528,9 +2535,7 @@
25282535
2529 /* Swap it if needed */2536 /* Swap it if needed */
2530 if (priv->menuservice == NULL) {2537 if (priv->menuservice == NULL) {
2531 gchar * path = g_strdup_printf(DEFAULT_ITEM_PATH "/%s/Menu", priv->clean_id);2538 priv->menuservice = dbusmenu_server_new (NOTIFICATION_ITEM_DBUS_OBJ "/Menu");
2532 priv->menuservice = dbusmenu_server_new (path);
2533 g_free(path);
2534 }2539 }
25352540
2536 dbusmenu_server_set_root (priv->menuservice, root);2541 dbusmenu_server_set_root (priv->menuservice, root);
@@ -2541,4 +2546,4 @@
2541 }2546 }
25422547
2543 return;2548 return;
2544}2549}
2545\ No newline at end of file2550\ No newline at end of file
25462551
=== modified file 'src/dbus-shared.h'
--- src/dbus-shared.h 2011-01-14 02:05:12 +0000
+++ src/dbus-shared.h 2015-06-27 17:40:16 +0000
@@ -28,8 +28,9 @@
28#define NOTIFICATION_WATCHER_DBUS_OBJ "/StatusNotifierWatcher"28#define NOTIFICATION_WATCHER_DBUS_OBJ "/StatusNotifierWatcher"
29#define NOTIFICATION_WATCHER_DBUS_IFACE "org.kde.StatusNotifierWatcher"29#define NOTIFICATION_WATCHER_DBUS_IFACE "org.kde.StatusNotifierWatcher"
3030
31#define NOTIFICATION_ITEM_DBUS_ADDR "org.kde.StatusNotifierItem"
32#define NOTIFICATION_ITEM_DBUS_OBJ "/StatusNotifierItem"
31#define NOTIFICATION_ITEM_DBUS_IFACE "org.kde.StatusNotifierItem"33#define NOTIFICATION_ITEM_DBUS_IFACE "org.kde.StatusNotifierItem"
32#define NOTIFICATION_ITEM_DEFAULT_OBJ "/StatusNotifierItem"
3334
34#define NOTIFICATION_APPROVER_DBUS_IFACE "org.ayatana.StatusNotifierApprover"35#define NOTIFICATION_APPROVER_DBUS_IFACE "org.ayatana.StatusNotifierApprover"
3536

Subscribers

People subscribed via source and target branches