Ever since I migrated to using SNI tray with indicators, I've had problems with Slack and Signal not updating their icons (they both add graphical flourishes to indicate things like whether there are unread messages or not). When I start them up, the icon in Taffybar correctly shows whatever state they're in at that time, and then never changes.
I noticed that Taffybar's stderr emits messages about failing to get pixbufs, with iconThemePath set to folders like /tmp/.org.chromium.Chromium.<randomstring>
that don't exist, exactly when the icon should be changing (new message recieved, or I click on the last unread message, etc). So I did a bit more digging.
In dbus-monitor
, when I start up Slack (with my Taffybar SNI tray running), I can see this section:
method call time=1530493694.000590 sender=:1.66 -> destination=:1.71 serial=31 path=/org/ayatana/NotificationItem/Slack1; interface=org.freedesktop.DBus.Properties; member=Get
string "org.kde.StatusNotifierItem"
string "IconPixmap"
error time=1530493694.000937 sender=:1.71 -> destination=:1.66 error_name=org.freedesktop.DBus.Error.InvalidArgs reply_serial=31
string "No such property 'IconPixmap'"
method call time=1530493694.001166 sender=:1.66 -> destination=:1.71 serial=32 path=/org/ayatana/NotificationItem/Slack1; interface=org.freedesktop.DBus.Properties; member=Get
string "org.kde.StatusNotifierItem"
string "IconName"
method return time=1530493694.060064 sender=:1.71 -> destination=:1.66 serial=21 reply_serial=32
variant string "Slack1_2"
method call time=1530493694.060298 sender=:1.66 -> destination=:1.71 serial=33 path=/org/ayatana/NotificationItem/Slack1; interface=org.freedesktop.DBus.Properties; member=Get
string "org.kde.StatusNotifierItem"
string "IconThemePath"
method return time=1530493694.065481 sender=:1.71 -> destination=:1.66 serial=22 reply_serial=33
variant string "/tmp/.org.chromium.Chromium.Vke7A3"
:1.66
seems to be Taffybar and :1.71
seems to be Slack. Taffybar asks for a direct pixbuf, which doesn't exist, so then it asks for the icon name and theme path. Sure enough, the theme path mentioned contains a file for the icon name mentioned:
% ls /tmp/.org.chromium.Chromium.Vke7A3
Slack1_2.png
And everything works at this point. The icon is displayed correctly. After a message comes in and the icon should be updated (but actually remains unchanged), Taffybar's log says:
Failed to get pixbuf for ItemInfo {itemServiceName = BusName ":1.71", itemServicePath = ObjectPath "/org/ayatana/NotificationItem/Slack1", iconTitle = "slack", iconName = "Slack1_4", iconThemePath = Just "/tmp/.org.chromium.Chromium.Vke7A3", iconPixmaps = [], menuPath = Just (ObjectPath "/org/ayatana/NotificationItem/Slack1/Menu")}
It's still using /tmp/.org.chromium.Chromium.Vke7A3
as the icon theme path, which no longer exists (Electron cleaned up the tmp folder I guess):
% ls /tmp/.org.chromium.Chromium.Vke7A3
ls: cannot access '/tmp/.org.chromium.Chromium.Vke7A3': No such file or directory
At the same time, dbus-monitor shows this sequence:
signal time=1530494718.862148 sender=:1.71 -> destination=(null destination) serial=42 path=/org/ayatana/NotificationItem/Slack1; interface=org.kde.StatusNotifierItem; member=NewIconThemePath
string "/tmp/.org.chromium.Chromium.zLsFh7"
signal time=1530494718.862196 sender=:1.71 -> destination=(null destination) serial=43 path=/org/ayatana/NotificationItem/Slack1; interface=org.kde.StatusNotifierItem; member=NewIcon
method call time=1530494718.862513 sender=:1.66 -> destination=:1.71 serial=46 path=/org/ayatana/NotificationItem/Slack1; interface=org.freedesktop.DBus.Properties; member=Get
string "org.kde.StatusNotifierItem"
string "IconName"
method return time=1530494718.862868 sender=:1.71 -> destination=:1.66 serial=44 reply_serial=46
variant string "Slack1_4"
method call time=1530494718.863173 sender=:1.66 -> destination=:1.71 serial=47 path=/org/ayatana/NotificationItem/Slack1; interface=org.freedesktop.DBus.Properties; member=Get
string "org.kde.StatusNotifierItem"
string "IconPixmap"
error time=1530494718.863299 sender=:1.71 -> destination=:1.66 error_name=org.freedesktop.DBus.Error.InvalidArgs reply_serial=47
string "No such property 'IconPixmap'"
Slack sent a broadcast NewIconThemePath message. And the Slack1_4
icon does exist in that path:
% ls /tmp/.org.chromium.Chromium.zLsFh7
Slack1_4.png
As further events happen, the Taffybar log continues to show "Failed to get pixbuf for ItemInfo" messages containing the same iconThemePath
, but it seems like Slack generates a new temp folder every time it updates its icon. So It seems that gtk-sni-tray isn't responding to the NewIconThemePath messages.
The Signal desktop app seems to behave exactly the same way. Both are based on the Electron framework, which uses Chromium for the front end, so I presume they're using common code to update their icons which generates the /tmp/.org.chromium.Chromium.*/
paths. This leads me to expect that this will be a problem for Electron-based apps in general.