Closed rodrigoramos closed 12 months ago
How is Slack installed? Might be something with Nix, otherwise I have no idea what could cause this.
You are assigning TrayItem.icon
to an Icon.icon
right?
The Slack was installed using apt
.
And yes, I'm assigning TrayItem.icon
to a Icon.icon
. That's my code for it:
const SysTray = () =>
Widget.Box({
connections: [
[
SystemTray,
(self) => {
self.children = SystemTray.items.map((item) =>
Widget.Button({
child: Widget.Icon({ binds: [["icon", item, "icon"]] }),
onPrimaryClick: (_, event) => item.activate(event),
onSecondaryClick: (_, event) => item.openMenu(event),
binds: [["tooltip-markup", item, "tooltip-markup"]],
})
);
},
],
],
});
Besides that, I noticed that I soon as I start the AGS the icon tray works properly. But when it does change its status, I got the broken icon.
I'll try to inspect better the icon changes.
Hi, @Aylur !
I was able to pinpoint the problem. It looks like that Slack (maybe any electron based apps?) is using temporary Icon Themes and when the icon changes, the IconThemePath also changes. I noticed that when I was debugging the iconName keeps changing.
So, in order to fix it, I appended on Systray service, method _refreshAllProperties
, inside of call
method callback the follow lines:
if (this._proxy.IconThemePath) {
if (!this._iconTheme) this._iconTheme = Gtk.IconTheme.new();
this._iconTheme.set_search_path([this._proxy.IconThemePath]);
}
Making the final _refreshAllProperties
method looks like:
_refreshAllProperties() {
this._proxy.g_connection.call(
this._proxy.g_name,
this._proxy.g_object_path,
'org.freedesktop.DBus.Properties',
'GetAll',
new GLib.Variant('(s)', [this._proxy.g_interface_name]),
new GLib.VariantType('(a{sv})'),
Gio.DBusCallFlags.NONE, -1,
null,
(proxy, result) => {
const variant = proxy?.call_finish(result);
if (!variant)
return;
const [properties] = variant.deepUnpack();
Object.entries(properties).map(([propertyName, value]) => {
this._proxy.set_cached_property(propertyName, value);
});
// THAT'S THE NEW CODE
if (this._proxy.IconThemePath) {
if (!this._iconTheme) this._iconTheme = Gtk.IconTheme.new();
this._iconTheme.set_search_path([this._proxy.IconThemePath]);
}
// END OF THE NEW CODE
this._notify();
},
);
}
How should we proceed?
that would seem to solve the issue, you should open up a PR
Hi, there!
I'm running Ags on Ubuntu/Sway and everything is working fine besides de system tray with Slack. When there is no unread message, Slack would show its icon without any difference. But as soon as I received a new message, it should show its icon with a small red ballon on the right bottom space (like this https://helpdeskgeek.com/wp-content/pictures/2020/03/slack-desktop-tray-features.png) but red instead of green-ish).
In the AGS log a received the following message:
It's important to say, that I do have the hicolor theme installed (through apt) :
What am I missing? Is there anything related to some specific icon theme?
Some Notes (that could be OR not be releated):