Skip to content

Commit

Permalink
notification: Add platform data to ActionInvoked signal
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jsparber committed Mar 4, 2024
1 parent 6d1d0b1 commit c589c7f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,17 @@ activate_action (GDBusConnection *connection,
G_DBUS_CALL_FLAGS_NONE,
-1, NULL, NULL, NULL);

/* The application may not implement the `org.freedesktop.Application`, so
* also add the platform data containing the activation-token
* to the `ActionInvoked` signal */
if (activation_token)
{
g_variant_builder_init (&pdata, G_VARIANT_TYPE_VARDICT);
g_variant_builder_add (&pdata, "{sv}",
"activation-token", g_variant_new_string (activation_token));
g_variant_builder_add (&parms, "v", g_variant_builder_end (&pdata));
}

g_dbus_connection_emit_signal (connection,
NULL,
"/org/freedesktop/portal/desktop",
Expand Down

0 comments on commit c589c7f

Please sign in to comment.