-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Discord tray icon stopped working after sytem update #224
Comments
No idea at the moment. The python-dasbus package has been flagged out of date some time ago ("Need to Rebuild"). Maybe this is going to help? |
BTW: running Discord from the terminal reveals plenty of error messages, e.g.:
|
This module exceeds my skills by the way. @christian-schulze - any idea? |
I experience this issue as well as mentioned in #248. I wonder if my other issue is also related - are desktop notifications affected as well? For some apps it does not show the app icons but a placeholder. For example Slack and Network Manager notifications do not have proper icons next to the notification while notifications from the browser do. Please see the screenshot below |
It affects all Electron apps, as far as I know. If it comes to notifications: swaync is a third party app, so you need to ask for help on their repository. |
Interestingly enough the icon for nextcloud also does not show up. To my knowledge it isn't an electron app. I don't know if this is related, because it behaves slightly differently. Discord show a blank space that can not be clicked as an icon, whereas nextcloud shows nothing. I have to icon of gnome-encfs-manager working, so I know it works at least. |
just ran into this one with the latest nwg-shell packages on hyprland. in addition to electron packages, I've found that heroic game launcher's tray icon doesn't work, as well as |
Electron apps stopped displaying tray icons months ago. See several other issues. Unfortunately we still have no solution. :( |
BTW. Great piece of software! Nicely done and quick and easy to configure! I'm now using drawer, panel, dock, displays bits from your repository! |
I don't have much experience with using DBUS, so apologies in advanced as I might be using very incorrect terminology, but maybe the info I found will be useful? From listening to the dbus while having Current behavior:When discord starts up, What I did:We need to call the DBUS to service_name, object_path = get_service_name_and_object_path(full_service_service)
# Handle the case for Discord
if object_path == "/StatusNotifierItem":
dbus = self.session_bus.get_proxy('org.freedesktop.DBus', '/org/freedesktop/DBus')
owner_name = dbus.GetNameOwner(service_name)
# Results in some thing like `:1.xxxx`
print(f"Owner of {service_name} is {owner_name}")
object_path = '/StatusNotifierItem'
sni_proxy = self.session_bus.get_proxy(owner_name, object_path)
sni_properties = sni_proxy.GetAll('org.kde.StatusNotifierItem')
for property_name, property_value in sni_properties.items():
# Prints the properties like "IconPixmap, Status, etc."
print(f"{property_name}: {property_value}")
if self.find_item(service_name, object_path) is None:
item = StatusNotifierItem(service_name, object_path)
item.set_on_loaded_callback(self.item_loaded_handler)
item.set_on_updated_callback(self.item_updated_handler)
self._statusNotifierItems.append(item) However I'm not sure how to integrate this into the library, because of how we need to get a proxy and then call "GetAll" on it to get the properties, while it looks like the current implementation is able to access the properties directly on the proxy. |
Thank you! I had no idea how to fix it so far, but let's learn what @agentx3 comes up with. |
Thank you very much for your effort. It's too late tonight, but I'll check out your findings tomorrow. |
Well, for Discord |
Ah, yeah you'll have to tell me what is needed. I looked at the interaction between waybar and discord, and this seems to be the behavior when the icon updates (when first started, it's the simple icon, but I have unread messages, so once it logs me in the icon changes, and this is the beginning of that sequence) Here, # discord sends a dbus signal to listeners that its properties has changed
signal time=1705549945.844904 sender=:1.917 -> destination=(null destination) serial=21 path=/StatusNotifierItem; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.kde.StatusNotifierItem"
array [
]
array [
# Icon has changed
string "IconPixmap"
]
# Discord signals to listeners about NewIcon
signal time=1705549945.844916 sender=:1.917 -> destination=(null destination) serial=22 path=/StatusNotifierItem; interface=org.kde.StatusNotifierItem; member=NewIcon
# Waybar presumably detects the signal, and invokes GetAll to get the new properties
method call time=1705549945.855221 sender=:1.47 -> destination=:1.917 serial=10920 path=/StatusNotifierItem; interface=org.freedesktop.DBus.Properties; member=GetAll
string "org.kde.StatusNotifierItem"
method call time=1705549945.855231 sender=:1.47 -> destination=:1.917 serial=10921 path=/StatusNotifierItem; interface=org.freedesktop.DBus.Properties; member=GetAll
string "org.kde.StatusNotifierItem"
method call time=1705549945.855241 sender=:1.47 -> destination=:1.917 serial=10922 path=/StatusNotifierItem; interface=org.freedesktop.DBus.Properties; member=GetAll
string "org.kde.StatusNotifierItem"
method return time=1705549945.855372 sender=:1.917 -> destination=:1.47 serial=23 reply_serial=10920
# <The same properties of sni_proxy from the python block are returned> I would imagine that it works similarly for the other properties, but I can look into it more if it turns out that's not the case. Is this information pertinent to your concerns? Side note, python syntax highlighting worked surprisingly well for that code block |
Wish I knew. I not the author of this module. |
Ah darn. Well I might get around to hacking at it more eventually. For anyone that's interested reading this, I believe this might be the solution: |
Thanks in advance if you'd like to devote your time to this. |
Just wanted to chime in to show my support for this feature being added/improved. The project as a whole seems to be amazing, would love to move to using it over waybar. The issue is that not seeing half of my apps on the tray bar simply makes it unusable for me as apps like Feishin can only be brought back using the tray. I did look at the code but it's sadly beyond my abilities and willingness to get familiar with the codebase. |
I looked at it for another electron application (mullvad-vpn) and it is missing the introspection data. dasbus relies on that to create the properties. One option would be to manually read the properties using _SNI_XML = """
## contents of https://github.com/Alexays/Waybar/blob/26329b660af3169b9daad533017964f35ba98726/protocol/dbus-status-notifier-item.xml
""" def item_available_handler(self, _observer):
self.item_proxy = self.session_bus.get_proxy(self.service_name, self.object_path)
try:
spec = self.item_proxy._handler.specification
if spec is not None:
if not any("StatusNotifierItem" in ifname for ifname in spec.interfaces):
DBusSpecificationParser._parse_xml(spec, _SNI_XML)
except:
pass
if hasattr(self.item_proxy, "PropertiesChanged"):
... |
PRs welcome :) |
Electron does not offer introspection data. Add the interface specification manually to make it usable anyways.
@nwg-piotr Any plan on tagging a new release including the fix? If not, I can backport the fix in the current Arch package. |
Sure, could be done in a minute, if you want. |
I mean, it's up to you. Either way I can include the fix in the Arch package :) |
Ready. |
Thanks! |
just wanted to confirm that this fixes two problematic system tray apps for me (discord and heroic game launcher), really appreciate the work that went into this ticket, y'all. 💖 |
Describe the bug
The Discord tray icon stopped showing on my system after a system update, while others still work. I mainly use the Discord flatpak, but I tried installing the discord AUR package, as well as the Webcord flatpak, and all of them have the same issue.
journalctl
shows an error as follows:To Reproduce
Steps to reproduce the behavior:
Expected behavior
All system tray icons should work.
Screenshots
N/A
Desktop (please complete the following information):
Additional context
My suspicions is that it might have something to do with Arch updating to Python 3.11 from 3.10, where AUR packages that depends on Python break, and which before that the Discord tray icon still worked. I've rebuilt all my AUR packages that use Python (including python-dasbus) and all other system tray icons work from what I've tested so far, so I'm not sure why Discord specifically is having problems.
The text was updated successfully, but these errors were encountered: