]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkprintoperation-unix.c
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gtk / gtkprintoperation-unix.c
index 4fae6d7633d59e6079b7d990e9642f52ddb3bbd1..6b24217987798535f9636196d08673ac633f97e6 100644 (file)
@@ -14,9 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
@@ -108,6 +106,11 @@ unix_start_page (GtkPrintOperation *op,
          }
       else if (type == CAIRO_SURFACE_TYPE_PDF)
         {
+          if (!op->priv->manual_orientation)
+            {
+              w = gtk_page_setup_get_paper_width (page_setup, GTK_UNIT_POINTS);
+              h = gtk_page_setup_get_paper_height (page_setup, GTK_UNIT_POINTS);
+            }
           cairo_pdf_surface_set_size (op_unix->surface, w, h);
         }
     }
@@ -385,9 +388,9 @@ unix_end_run (GtkPrintOperation *op,
       g_object_ref (op);
       if (!op_unix->data_sent)
        {
-         GDK_THREADS_LEAVE ();  
+         gdk_threads_leave ();  
          g_main_loop_run (op_unix->loop);
-         GDK_THREADS_ENTER ();  
+         gdk_threads_enter ();  
        }
       g_main_loop_unref (op_unix->loop);
       op_unix->loop = NULL;
@@ -831,12 +834,10 @@ _gtk_print_operation_platform_backend_resize_preview_surface (GtkPrintOperation
                                                              GtkPageSetup      *page_setup,
                                                              cairo_surface_t   *surface)
 {
-  GtkPaperSize *paper_size;
   gdouble w, h;
   
-  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);
+  w = gtk_page_setup_get_paper_width (page_setup, GTK_UNIT_POINTS);
+  h = gtk_page_setup_get_paper_height (page_setup, GTK_UNIT_POINTS);
   cairo_pdf_surface_set_size (surface, w, h);
 }
 
@@ -878,9 +879,9 @@ _gtk_print_operation_platform_backend_run_dialog (GtkPrintOperation *op,
       find_printer (printer_name,
                    (GFunc) found_printer, &rdata);
 
-      GDK_THREADS_LEAVE ();  
+      gdk_threads_leave ();  
       g_main_loop_run (rdata.loop);
-      GDK_THREADS_ENTER ();  
+      gdk_threads_enter ();  
 
       g_main_loop_unref (rdata.loop);
       rdata.loop = NULL;