summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-01-21 19:41:01 +0100
committerStefano Karapetsas <[email protected]>2014-01-21 19:41:01 +0100
commitfe6eafd44e7664b942a13cb2ac0ced50e37b7481 (patch)
treed2801065053d756b815c1fec6ebf566d9743e777
parent0deaac8188e7479967ca059fb59404e1aeac0dce (diff)
downloadatril-1.7.0.tar.bz2
atril-1.7.0.tar.xz
libview: gdk_display_get_app_launch_context is available only in GTK3atril-1.7.0
Add fix for GTK2
-rw-r--r--libview/ev-print-operation.c5
-rw-r--r--shell/ev-application.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/libview/ev-print-operation.c b/libview/ev-print-operation.c
index e81b156e..3cec253a 100644
--- a/libview/ev-print-operation.c
+++ b/libview/ev-print-operation.c
@@ -872,7 +872,12 @@ export_print_done (EvPrintOperationExport *export)
app = g_app_info_create_from_commandline (cmd, NULL, 0, &error);
if (app != NULL) {
+#if GTK_CHECK_VERSION (3, 0, 0)
ctx = gdk_display_get_app_launch_context (gtk_widget_get_display (GTK_WIDGET (export->parent_window)));
+#else
+ ctx = gdk_app_launch_context_new ();
+ gdk_app_launch_context_set_display (ctx, gtk_widget_get_display (GTK_WIDGET (export->parent_window)));
+#endif
gdk_app_launch_context_set_screen (ctx, gtk_window_get_screen (export->parent_window));
g_app_info_launch (app, NULL, G_APP_LAUNCH_CONTEXT (ctx), &error);
diff --git a/shell/ev-application.c b/shell/ev-application.c
index f43b10b4..96d9691b 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -288,7 +288,12 @@ ev_spawn (const char *uri,
app = g_app_info_create_from_commandline (cmdline, NULL, 0, &error);
if (app != NULL) {
+#if GTK_CHECK_VERSION (3, 0, 0)
ctx = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
+#else
+ ctx = gdk_app_launch_context_new ();
+ gdk_app_launch_context_set_display (ctx, gdk_screen_get_display (screen));
+#endif
gdk_app_launch_context_set_screen (ctx, screen);
gdk_app_launch_context_set_timestamp (ctx, timestamp);