summaryrefslogtreecommitdiff
path: root/libmate-desktop/mate-desktop-utils.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-06-21 17:06:05 +0200
committerMichal Ratajsky <[email protected]>2014-06-21 17:06:05 +0200
commitc8a5baeca9b85c30b7f2b5443a3356ceaa15ee41 (patch)
tree624d202a660c3ac5badcc76695aa2826c45c90a1 /libmate-desktop/mate-desktop-utils.c
parentbee8e1b426472921a6f1b95634087aa66a62a19e (diff)
downloadmate-desktop-c8a5baeca9b85c30b7f2b5443a3356ceaa15ee41.tar.bz2
mate-desktop-c8a5baeca9b85c30b7f2b5443a3356ceaa15ee41.tar.xz
Correctly support GDK2 and GDK3 without a deprecation warning
Diffstat (limited to 'libmate-desktop/mate-desktop-utils.c')
-rw-r--r--libmate-desktop/mate-desktop-utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libmate-desktop/mate-desktop-utils.c b/libmate-desktop/mate-desktop-utils.c
index a4454d8..98e4208 100644
--- a/libmate-desktop/mate-desktop-utils.c
+++ b/libmate-desktop/mate-desktop-utils.c
@@ -196,8 +196,13 @@ mate_gdk_spawn_command_line_on_screen (GdkScreen *screen, const gchar *command,
appinfo = g_app_info_create_from_commandline (command, NULL, G_APP_INFO_CREATE_NONE, error);
if (appinfo) {
+#if GTK_CHECK_VERSION (3, 0, 0)
+ context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
+#else
+ /* Deprecated in GDK 3.0 */
context = gdk_app_launch_context_new ();
gdk_app_launch_context_set_screen (context, screen);
+#endif
res = g_app_info_launch (appinfo, NULL, G_APP_LAUNCH_CONTEXT (context), error);
g_object_unref (context);
g_object_unref (appinfo);