From ad99d9dff8f8e8ee78b5195d6ca440af130f6ab6 Mon Sep 17 00:00:00 2001 From: Calvin Lee Date: Tue, 24 Oct 2017 11:59:42 -0600 Subject: Allow registering StatusNotifierItems by obj path This commit impliments a KDE hidden feature where a SNI could be registered by object path instead of well-known name. This should allow libappindicator programs to work correctly under sway. See #1372 --- include/swaybar/tray/sni.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/swaybar/tray/sni.h') diff --git a/include/swaybar/tray/sni.h b/include/swaybar/tray/sni.h index c2544e2a..22991e53 100644 --- a/include/swaybar/tray/sni.h +++ b/include/swaybar/tray/sni.h @@ -9,6 +9,8 @@ struct StatusNotifierItem { char *name; /* Unique bus name, needed for determining signal origins */ char *unique_name; + /* Object path, useful for items not registerd by well known name */ + char *object_path; bool kde_special_snowflake; cairo_surface_t *image; @@ -31,6 +33,12 @@ void sni_icon_ref_free(struct sni_icon_ref *sni_ref); * May return `NULL` if `name` is not valid. */ struct StatusNotifierItem *sni_create(const char *name); +/** + * Same as sni_create, but takes an object path and unique name instead of + * well-known name. + */ +struct StatusNotifierItem *sni_create_from_obj_path(const char *unique_name, + const char *object_path); /** * `item` must be a struct StatusNotifierItem * -- cgit v1.2.3-54-g00ecf