summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-10-13 16:20:51 +0200
committerStefano Karapetsas <[email protected]>2014-10-13 16:20:51 +0200
commitcee6caa16804a4c4b539518b37d81c1470ca9270 (patch)
tree9a7c70ea8e185c0506aa9d509d58871f6fe75ba6 /shell
parentb3e9be8eaef65934ca7025e22232138377a27541 (diff)
downloadatril-cee6caa16804a4c4b539518b37d81c1470ca9270.tar.bz2
atril-cee6caa16804a4c4b539518b37d81c1470ca9270.tar.xz
Uses g_app_info_launch_uris instead of g_app_info_launch to spawn other sessions
Closes https://github.com/mate-desktop/atril/issues/86 Solution comes from evince code
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-application.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/shell/ev-application.c b/shell/ev-application.c
index 220519d1..da6366f8 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -282,12 +282,13 @@ ev_spawn (const char *uri,
break;
}
- g_string_append_printf (cmd, " %s", uri);
-
cmdline = g_string_free (cmd, FALSE);
app = g_app_info_create_from_commandline (cmdline, NULL, 0, &error);
if (app != NULL) {
+ GList uri_list;
+ GList *uris = NULL;
+
#if GTK_CHECK_VERSION (3, 0, 0)
ctx = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
#else
@@ -297,7 +298,12 @@ ev_spawn (const char *uri,
gdk_app_launch_context_set_screen (ctx, screen);
gdk_app_launch_context_set_timestamp (ctx, timestamp);
- g_app_info_launch (app, NULL, G_APP_LAUNCH_CONTEXT (ctx), &error);
+ if (uri) {
+ uri_list.data = (gchar *)uri;
+ uri_list.prev = uri_list.next = NULL;
+ uris = &uri_list;
+ }
+ g_app_info_launch_uris (app, uris, G_APP_LAUNCH_CONTEXT (ctx), &error);
g_object_unref (app);
g_object_unref (ctx);