-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
Linux: wrong app name in notification #715
Comments
Streamlink Twitch GUI is a NW.js application, not Electron. Anything regarding Electron is not relevant. This has also nothing to do with Gnome or any other desktop environment.
Notifications are created via the chrome notifications API and on Linux, "freedesktop notifications" are being used as notification provider. Streamlink Twitch GUI sets all parameters correctly which are available on the chrome notifications API. The "nwjs" part is set somewhere internally in NW.js's Chromium part, not sure where.
If this bug hasn't been fixed yet in the latest NW.js release, which Streamlink Twitch GUI is currently not using, so I can't tell, then this has to be reported on the NW.js bug tracker.
Icons on notifications are part of the freedesktop notification protocol. Streamlink Twitch GUI always sets an icon, either its own icon from the embedded files (png) when clicking the test notifications button in the settings menu or when it's a group-notification, or the Twitch channel's icon on single notifications (png or jpeg).
Other icons related to the app, eg. those loaded by task bars, app switchers, etc., are either icons of the freedesktop icon specification (the AUR package and the add-menuitem.sh in the regular release archive create these icons) or icons from the window's embedded icon on X11 (see #665). |
Sorry for the confusion. Not using these technologies and being not knowledgeable enough about those, I tended to consider every desktop application built upon Web technologies as being Electron applications, my bad.
Just to clarify this: the issue I report relate only to Linux, probably Gnome desktop (I didn't launched others desktops recently. I might do those too), and only to notifications, both on the lock screen and in Gnome-shell. Application icon in the alt-tab switcher is fine, as well as the one in gnome-shell and in Gnome menubar. |
This is how the notify call works:
If you trigger a custom notification from your shell, like this gdbus call \
--session \
--dest org.freedesktop.Notifications \
--object-path /org/freedesktop/Notifications \
--method org.freedesktop.Notifications.Notify \
my_app_name \
1234 \
gtk-dialog-info \
"The summary" \
"The body" \
'["foo","bar"]' \
'{}' \
0 you'll see that the "my_app_name" string gets displayed the same way "nwjs" does when NW.js triggers a notification. This means that NW.js is setting the wrong app name:
The icon can either be a string identified by the freedesktop icon spec, which will be looked up from your /usr/share/icons or ~/.local/share/icons directories, or a custom icon, if it's set as a full path with a leading As I've already said, Streamlink Twitch GUI always sets a custom notification icon path. So if Gnome doesn't display custom icons, then it's ignoring the spec, simple as that. |
Mmmh, then ok I understand all of the notification system is up to NW.js and freedesktop. What's strange though is that the code you're pointing to is identical for both releases, and looking at the blame untouched since three years. |
The bug just got fixed in NW.js: The issue here will be resolved with a version bump and package.json upgrade. Bumping NW.js could potentially cause issues though, as some NW.js internals have changed between the currently used version and the latest (next) one. Will need to check this stuff first. |
@bastimeyer Can we reopen this issue? Application name seems indeed fixed, but the icon is till the one I posted in my first post. |
As I've already pointed out, the correct icon URL according to Chromium's notifications interface is always set in the app code when sending a notification. What Chromium does is reading the icon from the provided URL (a local file that was downloaded by Streamlink Twitch GUI before triggering the notification) and from what it looks like, it's transcoding it to a PNG and then writing it to the system's temp dir (
A regular "product icon" (the NW.js icon - or Chromium icon on upstream Chromium) is set as the regular
You can monitor the
This means that the notification server / renderer needs to read the "real" icon from the This is how Chromium implements this and it's neither a Streamlink Twitch GUI nor a NW.js issue. However, I personally can't reproduce any notification icon issues while using the latest KDE Plasma version on Arch. |
I'm also on latest versions on ArchLinux, but saw issues on Gnome. Gotta check it on KDE someday then, but it's strange that while it works well on many environments (your KDE, Windows, mac), it fails to do so there. |
If Gnome doesn't support the The documentation of the
Windows and macOS work completely different and have nothing to do with DBus and the notificiations interface. |
I'm pretty much sure it used to work in the past. So my best guess considering that when it stopped to work there was no streamlink-twitch-gui update, is that there was a regression in Gnome. That's however quite difficult to report bugs there considering privacy issues around GitLab's account creation. |
Once again, this is a bug in Gnome's desktop notification implementation. I think I found the problem though. If you want to report this bug, you can link to this post here, but this is it for me. I won't spend any more time on investigating bugs which are out of scope of my application by three or more layers. As a reminder, this is the notification structure:
As another reminder, this is how the specification describes icon/image priority:
As I've already pointed out earlier, Chromium sets the "icon" which is set by the app code via the This is how Gnome handles the icon/image situation when reading a notification:
As you can see, according to the documentation, this is not how it's supposed to be handled. The |
Sorry, didn't wanted to be annoying or anything else, as said in my previous comment, I understand well this is a regression in other layers. |
Just as an information for anyone that would read here and for the record, seems like it was fixed in https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1616, from issue https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3616 On the other hand, I thought the option was there, I'm thinking one might prefer simple Twitch GUI standard icon for everything to pick? |
Bug report
Environment details
Operating system and version:
ArchLinux
Streamlink Twitch GUI version:
1.9.1
Streamlink version:
streamlink 1.3.1
Configuration details:
Gnome 3.36
Description
Since update a few weeks ago, streamlink-twitch-gui's notifications are not shown as being issued by "Streamlink Twitch GUI", but by "nwjs" instead. The same way, it doesn't use the project icon anymore, but use this one instead:
Expected / Actual behavior
It should use the correct issuer and icon for notifications.
Reproduction steps
As I believe issue happened after Gnome update or another component that was not
streamlink-twitch-gui
, I guess issue is rather that icon and issuer, maybe from electron, have changed of way to be used between now and previously. Can't say for sure what triggered the issue though.The text was updated successfully, but these errors were encountered: