summaryrefslogtreecommitdiff
path: root/shell/main.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-01-21 17:11:27 +0100
committerStefano Karapetsas <[email protected]>2014-01-21 17:11:27 +0100
commite4540e7be4b396c8b1bb34157c105e172ccdf0a1 (patch)
tree746a48a9c7256268879e5c48b5fe31d2e94d5af7 /shell/main.c
parent75173c8f5ebdac9a095a466af602d6b07324029f (diff)
downloadatril-e4540e7be4b396c8b1bb34157c105e172ccdf0a1.tar.bz2
atril-e4540e7be4b396c8b1bb34157c105e172ccdf0a1.tar.xz
shell: Add GTK3 support
Diffstat (limited to 'shell/main.c')
-rw-r--r--shell/main.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/shell/main.c b/shell/main.c
index 7f00c6f9..3164d3da 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -92,8 +92,6 @@ launch_previewer (void)
{
GString *cmd_str;
gchar *cmd;
- gint argc;
- gchar **argv;
gboolean retval = FALSE;
GError *error = NULL;
@@ -123,16 +121,16 @@ launch_previewer (void)
}
cmd = g_string_free (cmd_str, FALSE);
- g_shell_parse_argv (cmd, &argc, &argv, &error);
- g_free (cmd);
if (!error) {
- retval = gdk_spawn_on_screen (gdk_screen_get_default (),
- NULL, argv, NULL,
- G_SPAWN_SEARCH_PATH,
- NULL, NULL, NULL,
- &error);
- g_strfreev (argv);
+ GAppInfo *app;
+
+ app = g_app_info_create_from_commandline (cmd, NULL, 0, &error);
+
+ if (app != NULL) {
+ retval = g_app_info_launch (app, NULL, NULL, &error);
+ g_object_unref (app);
+ }
}
if (error) {
@@ -140,6 +138,8 @@ launch_previewer (void)
g_error_free (error);
}
+ g_free (cmd);
+
return retval;
}
@@ -260,9 +260,11 @@ main (int argc, char *argv[])
}
#endif
+#if !GLIB_CHECK_VERSION (2, 32, 0)
/* Init glib threads asap */
if (!g_thread_supported ())
g_thread_init (NULL);
+#endif
#ifdef ENABLE_NLS
/* Initialize the i18n stuff */