X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=libview%2Fev-print-operation.c;h=8c96dae4a225b85dd0b29d8438d901f3ee314704;hb=ab0edaffd2f1790ec8ac7ac17f90e0a8007b92cd;hp=1c93d90fededb13a5e2b15f210434597670a0058;hpb=da96134063e3f80a2774167a951225ff6924e0fd;p=evince.git diff --git a/libview/ev-print-operation.c b/libview/ev-print-operation.c index 1c93d90f..8c96dae4 100644 --- a/libview/ev-print-operation.c +++ b/libview/ev-print-operation.c @@ -855,33 +855,34 @@ export_print_done (EvPrintOperationExport *export) g_key_file_free (key_file); if (!error) { - gint argc; - gchar **argv; gchar *cmd; gchar *quoted_filename; gchar *quoted_settings_filename; + GAppInfo *app; + GdkAppLaunchContext *ctx; quoted_filename = g_shell_quote (export->temp_file); quoted_settings_filename = g_shell_quote (print_settings_file); cmd = g_strdup_printf ("evince-previewer --unlink-tempfile --print-settings %s %s", quoted_settings_filename, quoted_filename); - g_shell_parse_argv (cmd, &argc, &argv, &error); - g_free (quoted_filename); g_free (quoted_settings_filename); - g_free (cmd); - if (!error) { - gdk_spawn_on_screen (gtk_window_get_screen (export->parent_window), - NULL, argv, NULL, - G_SPAWN_SEARCH_PATH, - NULL, NULL, NULL, - &error); - } + app = g_app_info_create_from_commandline (cmd, NULL, 0, &error); - g_strfreev (argv); - } + if (app != NULL) { + ctx = gdk_display_get_app_launch_context (gtk_widget_get_display (GTK_WIDGET (export->parent_window))); + 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); + + g_object_unref (app); + g_object_unref (ctx); + } + + g_free (cmd); + } if (error) { if (print_settings_file)