From d43b2d52b4129bf3eb36af6083063cba8f40cbed Mon Sep 17 00:00:00 2001 From: Michal Hruby Date: Mon, 7 Feb 2011 21:25:33 +0100 Subject: [PATCH] Add more data about origin application to the "Launched" signal. This will help applications such as zeitgeist's datahub to collect more complete information about application launches, as the "actor" of a launch is important for zeitgeist's magic to work properly. --- gio/gdesktopappinfo.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index 1fe5ecf..987f073 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -943,6 +943,7 @@ notify_desktop_launch (GDBusConnection *session_bus, GVariantBuilder extras_variant; GList *iter; const char *desktop_file_id; + const char *gio_desktop_file; if (session_bus == NULL) return; @@ -957,6 +958,18 @@ notify_desktop_launch (GDBusConnection *session_bus, "startup-id", g_variant_new ("s", sn_id)); + gio_desktop_file = g_getenv ("GIO_LAUNCHED_DESKTOP_FILE"); + if (gio_desktop_file != NULL) + g_variant_builder_add (&extras_variant, "{sv}", + "origin-desktop-file", + g_variant_new_bytestring (gio_desktop_file)); + g_variant_builder_add (&extras_variant, "{sv}", + "origin-prgname", + g_variant_new_bytestring (g_get_prgname ())); + g_variant_builder_add (&extras_variant, "{sv}", + "origin-pid", + g_variant_new ("x", + (gint64)getpid ())); if (info->filename) desktop_file_id = info->filename; -- 2.7.4