summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-03-13 18:10:25 -0500
committerColin Walters <walters@verbum.org>2010-03-14 15:13:26 -0400
commit55feb804f012436dca6ac68fdbdd859484de99e5 (patch)
tree825c5773fd7f430e10778d66088b6d2fbce7ae28
parentab650a1bef7cb15926e0eb5de9cfa2e557eac7bd (diff)
downloadgtk+-55feb804f012436dca6ac68fdbdd859484de99e5.tar.gz
[startup notification] Set APPLICATION_ID
http://lists.freedesktop.org/archives/xdg/2010-February/011321.html In addition to ICON, BINARY_NAME etc., it's very helpful if launcher programs include the name of the .desktop file they're launching. This is APPLICATION_ID. https://bugzilla.gnome.org/show_bug.cgi?id=611118
-rw-r--r--configure.in3
-rw-r--r--gdk/x11/gdkapplaunchcontext-x11.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index 69d9ac6bcc..81a402f114 100644
--- a/configure.in
+++ b/configure.in
@@ -1719,7 +1719,8 @@ fi
CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"
-GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 $X_PACKAGES cairo-$cairo_backend"
+# Pull in gio-unix for GDesktopAppInfo usage, see at least gdkapplaunchcontext-x11.c
+GDK_PACKAGES="$PANGO_PACKAGES gio-unix-2.0 $X_PACKAGES cairo-$cairo_backend"
GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
#
diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c
index 3dace4aa5c..4a6f3c5add 100644
--- a/gdk/x11/gdkapplaunchcontext-x11.c
+++ b/gdk/x11/gdkapplaunchcontext-x11.c
@@ -26,6 +26,7 @@
#include <unistd.h>
#include <glib.h>
+#include <gio/gdesktopappinfo.h>
#include "gdkx.h"
#include "gdkapplaunchcontext.h"
@@ -282,6 +283,7 @@ _gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
char *description;
char *icon_name;
const char *binary_name;
+ const char *application_id;
char *screen_str;
char *workspace_str;
GIcon *icon;
@@ -353,6 +355,10 @@ _gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
else
workspace_str = NULL;
+ if (G_IS_DESKTOP_APP_INFO (info))
+ application_id = g_desktop_app_info_get_filename (G_DESKTOP_APP_INFO (info));
+ else
+ application_id = NULL;
startup_id = g_strdup_printf ("%s-%lu-%s-%s-%d_TIME%lu",
g_get_prgname (),
@@ -372,6 +378,7 @@ _gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
"DESKTOP", workspace_str,
"DESCRIPTION", description,
"WMCLASS", NULL, /* FIXME */
+ "APPLICATION_ID", application_id,
NULL);
g_free (description);