From 3f121d8dfd3ac48f9432e0e24d8c8d6c1951322c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Sun, 3 Jun 2018 16:07:29 +0100 Subject: [PATCH 1/2] Send the application ID when possible --- libnotify/notification.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libnotify/notification.c b/libnotify/notification.c index 88bbf2a..28bb200 100644 --- a/libnotify/notification.c +++ b/libnotify/notification.c @@ -558,6 +558,9 @@ notify_notification_show (NotifyNotification *notification, GHashTableIter iter; gpointer key, data; GVariant *result; +#ifdef GLIB_VERSION_2_32 + GApplication *application; +#endif g_return_val_if_fail (notification != NULL, FALSE); g_return_val_if_fail (NOTIFY_IS_NOTIFICATION (notification), FALSE); @@ -592,6 +595,17 @@ notify_notification_show (NotifyNotification *notification, g_variant_builder_add (&hints_builder, "{sv}", key, data); } +#ifdef GLIB_VERSION_2_32 + 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))); + } + } +#endif + /* TODO: make this nonblocking */ result = g_dbus_proxy_call_sync (proxy, "Notify", From 5794854f04a275add5d3a80cb8aa399ae75b3856 Mon Sep 17 00:00:00 2001 From: Marco Trevisan Date: Thu, 21 Apr 2022 13:47:18 +0000 Subject: [PATCH 2/2] Apply 1 suggestion(s) to 1 file(s) --- libnotify/notification.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnotify/notification.c b/libnotify/notification.c index 28bb200..906152b 100644 --- a/libnotify/notification.c +++ b/libnotify/notification.c @@ -601,7 +601,7 @@ notify_notification_show (NotifyNotification *notification, 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))); + g_variant_new_string (g_application_get_application_id (application))); } } #endif