diff --git a/data/org.freedesktop.impl.portal.Notification.xml b/data/org.freedesktop.impl.portal.Notification.xml index cea66de55..abd153b9a 100644 --- a/data/org.freedesktop.impl.portal.Notification.xml +++ b/data/org.freedesktop.impl.portal.Notification.xml @@ -47,6 +47,13 @@ The format of the @notification is the same as for :ref:`org.freedesktop.portal.Notification.AddNotification`. + It additionally can contain the following keys: + + * ``desktop-file-id`` (``s``) + + The desktop file ID of the app adding the notification. A desktop + file ID is the basename of the desktop file, including the + .desktop extension. Since version 2, the icon property never uses the ``bytes`` option. --> diff --git a/src/notification.c b/src/notification.c index 38494dad8..fa9b20c1c 100644 --- a/src/notification.c +++ b/src/notification.c @@ -1046,6 +1046,7 @@ handle_add_in_thread_func (GTask *task, { CallData *call_data = task_data; GVariantBuilder builder; + const char *desktop_file_id; g_autoptr(GError) error = NULL; CALL_DATA_AUTOLOCK (call_data); @@ -1077,6 +1078,10 @@ handle_add_in_thread_func (GTask *task, return; } + desktop_file_id = xdp_app_info_get_desktop_file_id (call_data->app_info); + if (desktop_file_id) + g_variant_builder_add (&builder, "{ss}", "desktop-file-id", desktop_file_id); + xdp_dbus_impl_notification_call_add_notification (impl, xdp_app_info_get_id (call_data->app_info), call_data->id,