diff options
author | Corentin Noël <corentin@elementary.io> | 2018-06-03 16:07:29 +0100 |
---|---|---|
committer | Corentin Noël <corentin@elementary.io> | 2018-06-03 16:07:29 +0100 |
commit | 9ee901cf709d1f17297b9a16536bfd879f22e6e4 (patch) | |
tree | 56dee693e5b46fb5fe6fae845a23ca26e1134bc7 /libnotify | |
parent | 43aac613f1c2a56aa672c36c157c9b8eb193ac25 (diff) | |
download | libnotify-wip/tintou/send-app-id.tar.gz |
Send the application ID when possiblewip/tintou/send-app-id
Diffstat (limited to 'libnotify')
-rw-r--r-- | libnotify/notification.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libnotify/notification.c b/libnotify/notification.c index 88bbf2a..af65063 100644 --- a/libnotify/notification.c +++ b/libnotify/notification.c @@ -558,6 +558,7 @@ notify_notification_show (NotifyNotification *notification, GHashTableIter iter; gpointer key, data; GVariant *result; + GApplication *application; g_return_val_if_fail (notification != NULL, FALSE); g_return_val_if_fail (NOTIFY_IS_NOTIFICATION (notification), FALSE); @@ -592,6 +593,15 @@ notify_notification_show (NotifyNotification *notification, g_variant_builder_add (&hints_builder, "{sv}", key, data); } + application = g_application_get_default (); + if (application != NULL) { + GVariant *desktop_entry = g_hash_table_lookup (priv->hints, "desktop-entry"); + if (desktop_entry == NULL) { + g_variant_builder_add (&hints_builder, "{sv}", "desktop-entry", + g_variant_new_string (g_application_get_application_id (application))); + } + } + /* TODO: make this nonblocking */ result = g_dbus_proxy_call_sync (proxy, "Notify", |