diff options
author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2013-04-09 16:45:03 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-04-09 16:45:03 +0000 |
commit | 4d64b71006513b7b8928fac17bdcc974c05f29f8 (patch) | |
tree | a38c42cf660e5cfd18c0fc645537b8429c4d54f7 /libindicator | |
parent | 2d418a6199dce41dea87af2bccf3cd4ed65cfa48 (diff) | |
parent | bd9abfc7d47ae16cf92632a6d9507150338e7cfc (diff) | |
download | libayatana-indicator-4d64b71006513b7b8928fac17bdcc974c05f29f8.tar.gz libayatana-indicator-4d64b71006513b7b8928fac17bdcc974c05f29f8.tar.bz2 libayatana-indicator-4d64b71006513b7b8928fac17bdcc974c05f29f8.zip |
IndicatorDestkopShortcuts: add StartupNotify parameter in our internal fake .desktop file
Otherwise GAppInfo won't pass the relevant platform-data to the Application launched.
Plus, fix the docs. Fixes: https://bugs.launchpad.net/bugs/1164483, https://bugs.launchpad.net/bugs/1166890.
Approved by Mathieu Trudel-Lapierre, PS Jenkins bot.
Diffstat (limited to 'libindicator')
-rw-r--r-- | libindicator/indicator-desktop-shortcuts.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c index 12a9b0c..70d964e 100644 --- a/libindicator/indicator-desktop-shortcuts.c +++ b/libindicator/indicator-desktop-shortcuts.c @@ -555,9 +555,10 @@ indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, cons } /** - indicator_desktop_shortcuts_nick_exec: + indicator_desktop_shortcuts_nick_exec_with_context: @ids: The #IndicatorDesktopShortcuts object to look in @nick: Which command that we're referencing. + @launch_context: The #GAppLaunchContext to use for launching the shortcut Here we take a @nick and try and execute the action that is associated with it. The @nick parameter should be gotten @@ -630,9 +631,9 @@ indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * gchar * desktopdata = g_strdup_printf("[" G_KEY_FILE_DESKTOP_GROUP "]\n" G_KEY_FILE_DESKTOP_KEY_TYPE "=" G_KEY_FILE_DESKTOP_TYPE_APPLICATION "\n" G_KEY_FILE_DESKTOP_KEY_NAME "=%s\n" - G_KEY_FILE_DESKTOP_KEY_EXEC "=%s\n", - name, exec); - + G_KEY_FILE_DESKTOP_KEY_EXEC "=%s\n" + G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY "=%s\n", + name, exec, launch_context ? "true" : "false"); g_free(name); g_free(exec); /* g_debug("Desktop file: \n%s", desktopdata); */ @@ -653,7 +654,6 @@ indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * g_key_file_free(launcher); return FALSE; } - gboolean launched = g_app_info_launch(G_APP_INFO(appinfo), NULL, launch_context, &error); if (error != NULL) { @@ -669,6 +669,20 @@ indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * return launched; } +/** + indicator_desktop_shortcuts_nick_exec: + @ids: The #IndicatorDesktopShortcuts object to look in + @nick: Which command that we're referencing. + + Here we take a @nick and try and execute the action that is + associated with it. The @nick parameter should be gotten + from #indicator_desktop_shortcuts_get_nicks though it's not + required that the exact memory location be the same. + This function is deprecated and shouldn't be used in newly + written code. + + Return value: #TRUE on success or #FALSE on error. +*/ gboolean indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, const gchar * nick) { |