summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-program-choosing.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-07-25 15:12:51 +0200
committerStefano Karapetsas <[email protected]>2013-07-25 15:12:51 +0200
commita4f91079a8a8dda83614148ac50e7ef7e162c9b1 (patch)
treec3a4bb22dfd2f296532b2b66de289ed974a61421 /libcaja-private/caja-program-choosing.c
parentb965494b9c67f1e407c9c26bcc580e15838a64d3 (diff)
downloadcaja-a4f91079a8a8dda83614148ac50e7ef7e162c9b1.tar.bz2
caja-a4f91079a8a8dda83614148ac50e7ef7e162c9b1.tar.xz
libcaja-private: Add GDK3 support
Diffstat (limited to 'libcaja-private/caja-program-choosing.c')
-rw-r--r--libcaja-private/caja-program-choosing.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/libcaja-private/caja-program-choosing.c b/libcaja-private/caja-program-choosing.c
index bc9ee396..6971d2d9 100644
--- a/libcaja-private/caja-program-choosing.c
+++ b/libcaja-private/caja-program-choosing.c
@@ -322,7 +322,24 @@ caja_launch_application_from_command (GdkScreen *screen,
}
else
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkAppLaunchContext *launch_context;
+ GAppInfo *app_info = NULL;
+ app_info = g_app_info_create_from_commandline (full_command,
+ NULL,
+ G_APP_INFO_CREATE_NONE,
+ NULL);
+ if (app_info != NULL)
+ {
+ launch_context = gdk_app_launch_context_new ();
+ gdk_app_launch_context_set_screen (launch_context, screen);
+ g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (launch_context), NULL);
+ g_object_unref (launch_context);
+ g_object_unref (app_info);
+ }
+#else
gdk_spawn_command_line_on_screen (screen, full_command, NULL);
+#endif
}
g_free (full_command);
@@ -370,7 +387,24 @@ caja_launch_application_from_command_array (GdkScreen *screen,
}
else
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkAppLaunchContext *launch_context;
+ GAppInfo *app_info = NULL;
+ app_info = g_app_info_create_from_commandline (full_command,
+ NULL,
+ G_APP_INFO_CREATE_NONE,
+ NULL);
+ if (app_info != NULL)
+ {
+ launch_context = gdk_app_launch_context_new ();
+ gdk_app_launch_context_set_screen (launch_context, screen);
+ g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (launch_context), NULL);
+ g_object_unref (launch_context);
+ g_object_unref (app_info);
+ }
+#else
gdk_spawn_command_line_on_screen (screen, full_command, NULL);
+#endif
}
g_free (full_command);