Index: gtk/Makefile.am
===================================================================
--- gtk/Makefile.am	(révision 17250)
+++ gtk/Makefile.am	(copie de travail)
@@ -4,7 +4,7 @@ SUBDIRS=theme-bits
 
 if OS_UNIX
 SUBDIRS += xdgmime
-GTK_PRINT_PREVIEW_COMMAND="evince --unlink-tempfile --preview %f"
+GTK_PRINT_PREVIEW_COMMAND="evince --unlink-tempfile --preview %f --settings %s"
 endif
 
 DIST_SUBDIRS=theme-bits xdgmime
Index: gtk/gtkprintoperation-unix.c
===================================================================
--- gtk/gtkprintoperation-unix.c	(révision 17250)
+++ gtk/gtkprintoperation-unix.c	(copie de travail)
@@ -118,14 +118,16 @@ op_unix_free (GtkPrintOperationUnix *op_
 
 static gchar *
 shell_command_substitute_file (const gchar *cmd,
-			       const gchar *filename)
+			       const gchar *pdf_filename,
+			       const gchar *settings_filename)
 {
   const gchar *inptr, *start;
   gchar *result;
   GString *final;
 
   g_return_val_if_fail (cmd != NULL, NULL);
-  g_return_val_if_fail (filename != NULL, NULL);
+  g_return_val_if_fail (pdf_filename != NULL, NULL);
+  g_return_val_if_fail (settings_filename != NULL, NULL);
 
   result = NULL;
   final = g_string_new (NULL);
@@ -139,7 +141,11 @@ shell_command_substitute_file (const gch
       switch (*inptr) 
         {
           case 'f':
-            g_string_append (final, filename ? filename : "");
+            g_string_append (final, pdf_filename);
+            break;
+
+          case 's':
+            g_string_append (final, settings_filename);
             break;
 
           case '%':
@@ -176,29 +182,48 @@ _gtk_print_operation_platform_backend_la
   gchar *cmd;
   gchar *preview_cmd;
   GtkSettings *settings;
-  gchar *quoted_filename;
+  GtkPrintSettings *print_settings;
+  gchar *settings_filename, *quoted_filename, *quoted_settings_filename;
   GdkScreen *screen;
   GError *error = NULL;
+  gint fd;
 
   cairo_surface_destroy (surface);
  
-  settings = gtk_settings_get_default ();
+  if (parent)
+    screen = gtk_window_get_screen (parent);
+  else
+    screen = gdk_screen_get_default ();
+
+  settings_filename = g_build_filename (g_get_tmp_dir (), "settingsXXXXXX.ini", NULL);
+  fd = g_mkstemp (settings_filename);
+
+  print_settings = gtk_print_operation_get_print_settings (op);
+  if (!gtk_print_settings_to_file (print_settings, settings_filename, &error))
+    goto out;
+
+  close (fd);
+
+  settings = gtk_settings_get_for_screen (screen);
   g_object_get (settings, "gtk-print-preview-command", &preview_cmd, NULL);
 
   quoted_filename = g_shell_quote (filename);
-  cmd = shell_command_substitute_file (preview_cmd, quoted_filename);
+  quoted_settings_filename = g_shell_quote (settings_filename);
+  cmd = shell_command_substitute_file (preview_cmd, quoted_filename, quoted_settings_filename);
   g_shell_parse_argv (cmd, &argc, &argv, &error);
 
+  g_free (preview_cmd);
+  g_free (quoted_filename);
+  g_free (quoted_settings_filename);
+  g_free (cmd);
+
   if (error != NULL)
     goto out;
 
-  if (parent)
-    screen = gtk_window_get_screen (parent);
-  else
-    screen = gdk_screen_get_default ();
-  
   gdk_spawn_on_screen (screen, NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error);
 
+  g_strfreev (argv);
+
  out:
   if (error != NULL)
     {
@@ -216,13 +241,12 @@ _gtk_print_operation_platform_backend_la
 
       gtk_window_present (GTK_WINDOW (edialog));
 
-      g_error_free (error); 
+      g_error_free (error);
+
+      /* FIXME! Since launching failed, WE are responsible for cleaning up the temp files! */
    } 
 
-  g_free (cmd);
-  g_free (quoted_filename);
-  g_free (preview_cmd);
-  g_strfreev (argv);
+  g_free (settings_filename);
 }
 
 static void
@@ -629,8 +653,6 @@ _gtk_print_operation_platform_backend_cr
   fd = g_mkstemp (filename);
   *target = filename;
   
-  g_print ("target is %s\n", filename);
-
   paper_size = gtk_page_setup_get_paper_size (page_setup);
   w = gtk_paper_size_get_width (paper_size, GTK_UNIT_POINTS);
   h = gtk_paper_size_get_height (paper_size, GTK_UNIT_POINTS);
