-
Notifications
You must be signed in to change notification settings - Fork 103
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
notification: Set correct platform data for action activation #468
notification: Set correct platform data for action activation #468
Conversation
I didn't actually try the code yet since i didn't find a way to use it without writing a test app therefore it's marked as draft. |
On GNOME-Shell it shouldn't be using |
Ah, it does use FDO in some fallback paths. |
7eae929
to
2725627
Compare
I figured out how to try this. We can just monitor DBUS and use ashpd demo. |
2725627
to
2d8d831
Compare
2d8d831
to
47bfdab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why we decided to change the API was because I also wanted to make possible for apps using GNotification or portal api directly to be able to send such info, and not being limited to using the fdo API
If an action is activated via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks generally good to me, with a couple of minor nitpicks.
Since [1] FDO notifications can transfer a `ActivateToken` to the client application, we can use this token to set the correct platform data to get wayland startup notification working correctly. GNOME Shell gained the feature already in [2], so this is the last piece missing to get rid of the annoying "<Application> is ready" notifications, when clicking on a notification. We can set the platform data only for actions that are activated via `org.freedesktop.Application`. Fixes: flatpak#406 [1] https://gitlab.freedesktop.org/xdg/xdg-specs/-/commit/b9a470004d [2] https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3199/
d069cf5
to
760cfdd
Compare
…portal Since [1] the xdg-desktop-portal-gtk adds the activation-token to the ActionInvoked signal. We can store it and let apps use it like the activation-token we get from FDO. [1] flatpak/xdg-desktop-portal-gtk#468
Once this is merged we can consume the activation-token passed to |
Apps may not implement the `org.freedesktop.Application` interface so they won't get the platform data. We can do a little better and add the platform data to the `ActionInvoked` signal.
760cfdd
to
c589c7f
Compare
…portal Since [1] the xdg-desktop-portal-gtk adds the activation-token to the ActionInvoked signal. We can store it and let apps use it like the activation-token we get from FDO. [1] flatpak/xdg-desktop-portal-gtk#468
I believe this was merged as 48bbf07 |
Since [1] FDO notifications can transfer a
ActivateToken
to the client application, we can use this token to set the correct platform data to get wayland startup notification working correctly. GNOME Shell gained the feature already in [2], so this is the last piece missing to get rid of the annoying " is ready" notifications, when clicking on a notification.We can set the platform data for actions that are activated via
org.freedesktop.Application
.For apps that don't implement the
org.freedesktop.Application
interface we can add theplatform data to the
ActionInvoked
signal.Fixes: #406
[1] https://gitlab.freedesktop.org/xdg/xdg-specs/-/commit/b9a470004d
[2] https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3199/