flatpak / xdg-desktop-portal

Desktop integration portal
https://flatpak.github.io/xdg-desktop-portal/
GNU Lesser General Public License v2.1
603 stars 194 forks source link

[Bug]: App Name is not available when using Portal Notifications #916

Open Crylia opened 1 year ago

Crylia commented 1 year ago

Checklist

Flatpak version

1.12.7

What Linux distribution are you using?

Pop!_OS

Linux distribution version

22.04

What architecture are you using?

x86_64

How to reproduce

  1. Use any app that sends a notification
  2. see it having no app name

Expected Behavior

Portal notifications should be able to show the app name

Actual Behavior

Portal notifications won't show the app name

Additional Information

I'm not sure if its possible to expose something to get it working (I couldn't find anything in the docs related to notifications). Its quiet annoying to have notifications without an app name.

GeorgesStavracas commented 1 year ago

Please be more specific. Which specific apps have you used that trigger this behavior, and what did you expect to see?

Crylia commented 1 year ago

One example would be spotify, I would expect a notification to also contain the applications name, but it doesn't.

https://specifications.freedesktop.org/notification-spec/latest/ar01s09.html The freedesktop spec defines a "app_name" which is not set when using any application from within flatpak

swick commented 1 year ago

Is the app flatpak, snap or host? Which portal backend do you use?

Crylia commented 1 year ago

It would be a flatpak, a good example would be Spotify (app/com.spotify.Client/x86_64/stable)

swick commented 1 year ago

This is very likely an issue with a specific backend + compositor. Which ones do you use? I suspect xdg-desktop-portal-gtk and not gnoms-shell?

https://github.com/flatpak/xdg-desktop-portal-gtk/blob/366d3349041c2e06658c7c5a8b5bfd5f345d8157/src/fdonotification.c#L348

Crylia commented 1 year ago

How do I check/change the backend? I just use awesomewm with picom

swick commented 1 year ago

ps ax| grep xdg-desktop-portal might be sufficient, otherwise check which component supports the notification interface in /usr/share/xdg-desktop-portal/portals/ or use dbus-monitor to figure out what gets called.

Crylia commented 1 year ago
3239 ?        SNsl   0:00 /usr/libexec/xdg-desktop-portal
   3256 ?        SNsl   0:00 /usr/libexec/xdg-desktop-portal-gnome
   3265 ?        SNsl   0:00 /usr/libexec/xdg-desktop-portal-gtk
   3270 ?        SNsl   0:00 /usr/lib/x86_64-linux-gnu/libexec/xdg-desktop-portal-kde
  46431 pts/0    SN+    0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox xdg-desktop-portal

is the output from the first command, so ig I got three running?

swick commented 1 year ago

Yes, each can provide a number of portals. the gnome backend doesn't implement notifications, gtk does and I don't know about KDE (it probably does). You can check in /usr/share/xdg-desktop-portal/portals/kde.portal if it implements the notification Interface.

If both gtk and kde do then you can use dbus-monitor "interface='org.freedesktop.impl.portal.Notification'" to figure out which one gets called.

georg-mayer commented 1 year ago

Hi, I have the exact same problem - it is with a flatpak spotify installation on kbuntu (KDE). The error is annoying, as an error sound is played after every song. From the answers so far I don't know how to resolve the problem. Did I miss something? Thanks for any help on this!

ray-kast commented 11 months ago

Seconding this, I've been using xdg-desktop-portal-gtk with i3 for awhile and after a recent update to xdg-desktop-portal@1.18.1 and xdg-desktop-portal-gtk@1.15.1 notifications no longer have an attached app name. I've confirmed from using the above dbus-monitor command that xdg-desktop-portal-gtk is receiving the notifications.

b3niup commented 1 month ago

Same issue here with xdg-desktop-portal-gtk

rpetti commented 2 weeks ago

Noticed this with both the firefox and vencord flatpaks. Looks like app name isn't even a field in the portal notification spec, and there's no handling of it in the code, so I assume that's why it's coming across empty.