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.
This commit is contained in:
Matthias Clasen 2010-07-10 17:57:45 -04:00
parent 5f1490e94a
commit f8e22856c6
2 changed files with 6 additions and 4 deletions

View File

@ -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);

View File

@ -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;
/**