SUMMARY xdg-desktop-portal-kde doesn't remember action IDs and the target parameter supplied by applications and sends ActionInvoked signal with action ID used with communication to org.freedesktop.Notifications, but the application communicatin to the portal doesn't know anyhing about those IDs and expects the IDs and target parameters it supplied to the portal. It's also worth mentioning that for compatibility with applications using GNotification, org.freedesktop.Application.ActivateAction should be supported: https://github.com/flatpak/xdg-desktop-portal-gtk/blob/9702bacc1ae8de2f357974ced2bcd6997dfd4e69/src/notification.c#L119-L158 STEPS TO REPRODUCE 1. Get a notification with actions using the portal spec 2. Try to click on a button on the notificiation OBSERVED RESULT Nothing happens EXPECTED RESULT Application doing the action SOFTWARE/OS VERSIONS Operating System: NixOS 22.11 KDE Plasma Version: 5.26.3 KDE Frameworks Version: 5.99.0 Qt Version: 5.15.7 Kernel Version: 6.0.7-zen1 (64-bit) Graphics Platform: Wayland Processors: 8 × AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx Memory: 5.7 GB of RAM Graphics Processor: AMD Radeon Vega 8 Graphics
I've been looking your report up, but I was unable to reproduce the behaviour you are describing. Would you be able to provide a small test app that exposes the problem? Regarding the latter case, it indeed is missing but is a separate issue.
Created attachment 154117 [details] AddNotification
Created attachment 154118 [details] ActionInvoked
I don't think I'll be able to write a small test app (as GNotification uses ActivateAction, KNotification is written that it avoids this issue and writing new spec implementation wouldn't be small). What I propose instead is to look at d-bus traffic between the portal and any application using GNotification. Even though GNotification doesn't watch from ActionInvoked signal, it's seen that the content of the signal is broken. Here's a screenshot of the action list from Telegram and the ActionInvoked signal produced by the portal implementation. It's seen that Telegram has no numeric actions and has target parameter for every of them, but ActionInvoked content is completely different.
It's also pretty obvious from the code: https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/blob/master/src/notification.cpp#L125 It should have some map between the uint id and action name/target parameter supplied by the application, but it just supplies the uint id from KNotification library instead.
The application I use to monitor D-Bus traffic is Bustle
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/140
Git commit c53684f5b6d27b17938982e6333d574636dd4016 by Aleix Pol. Committed on 15/12/2022 at 00:52. Pushed by apol into branch 'master'. notifications: Properly communicate the triggered action Infer the action name from the originally communicated action name. M +34 -10 src/notification.cpp https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/c53684f5b6d27b17938982e6333d574636dd4016
Git commit 77c312560f0d240a553c074d96df438c75e1430a by Aleix Pol Gonzalez, on behalf of Aleix Pol. Committed on 15/12/2022 at 00:00. Pushed by apol into branch 'master'. notification: Trigger org.freedesktop.Application.Activate* as spec'd For some reason, it was spec'd that these should be called, so we better follow through. A +17 -0 data/org.freedesktop.Application.xml M +2 -0 src/CMakeLists.txt M +24 -5 src/notification.cpp https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/77c312560f0d240a553c074d96df438c75e1430a
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/142
Git commit 4f8df470f8b3b9df1844d606a05b3c83cce88772 by Aleix Pol. Committed on 15/12/2022 at 15:02. Pushed by apol into branch 'Plasma/5.26'. notifications: Properly communicate the triggered action Infer the action name from the originally communicated action name. (cherry picked from commit c53684f5b6d27b17938982e6333d574636dd4016) M +34 -10 src/notification.cpp https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/4f8df470f8b3b9df1844d606a05b3c83cce88772
Git commit 511bced812cc0615dfa8b827a1c108db4b3e919f by Aleix Pol. Committed on 15/12/2022 at 15:02. Pushed by apol into branch 'Plasma/5.26'. notification: Trigger org.freedesktop.Application.Activate* as spec'd For some reason, it was spec'd that these should be called, so we better follow through. (cherry picked from commit 77c312560f0d240a553c074d96df438c75e1430a) A +17 -0 data/org.freedesktop.Application.xml M +2 -0 src/CMakeLists.txt M +24 -5 src/notification.cpp https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/511bced812cc0615dfa8b827a1c108db4b3e919f