From fe6eafd44e7664b942a13cb2ac0ced50e37b7481 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Tue, 21 Jan 2014 19:41:01 +0100 Subject: libview: gdk_display_get_app_launch_context is available only in GTK3 Add fix for GTK2 --- libview/ev-print-operation.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libview/ev-print-operation.c') 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); -- cgit v1.2.1