From f8e22856c643bfccaf03db6f84738126cff374d0 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 10 Jul 2010 17:57:45 -0400 Subject: [PATCH] Add a GAppInfoCreate flag for startup-notification Using this flag, it will be possible to launch apps without a desktop file, in the same way that gdk_spawn_... lets you do. Requested in bug 599223. --- gio/gdesktopappinfo.c | 2 +- gio/gioenums.h | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index dd5fbaef0..8aa87385c 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -1655,7 +1655,7 @@ g_app_info_create_from_commandline (const char *commandline, info->desktop_id = NULL; info->terminal = flags & G_APP_INFO_CREATE_NEEDS_TERMINAL; - info->startup_notify = FALSE; + info->startup_notify = flags & G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION; info->hidden = FALSE; if (flags & G_APP_INFO_CREATE_SUPPORTS_URIS) info->exec = g_strconcat (commandline, " %u", NULL); diff --git a/gio/gioenums.h b/gio/gioenums.h index feb5d0373..3c761f33f 100644 --- a/gio/gioenums.h +++ b/gio/gioenums.h @@ -37,13 +37,15 @@ G_BEGIN_DECLS * @G_APP_INFO_CREATE_NONE: No flags. * @G_APP_INFO_CREATE_NEEDS_TERMINAL: Application opens in a terminal window. * @G_APP_INFO_CREATE_SUPPORTS_URIS: Application supports URI arguments. + * @G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION: Application supports startup notification. Since 2.26 * * Flags used when creating a #GAppInfo. */ typedef enum { - G_APP_INFO_CREATE_NONE = 0, /*< nick=none >*/ - G_APP_INFO_CREATE_NEEDS_TERMINAL = (1 << 0), /*< nick=needs-terminal >*/ - G_APP_INFO_CREATE_SUPPORTS_URIS = (1 << 1) /*< nick=supports-uris >*/ + G_APP_INFO_CREATE_NONE = 0, /*< nick=none >*/ + G_APP_INFO_CREATE_NEEDS_TERMINAL = (1 << 0), /*< nick=needs-terminal >*/ + G_APP_INFO_CREATE_SUPPORTS_URIS = (1 << 1), /*< nick=supports-uris >*/ + G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION = (1 << 2) /*< nick=supports-startup-notification >*/ } GAppInfoCreateFlags; /**