]> Pileus Git - ~andy/gtk/commitdiff
Take printer margins into account on Windows
authorAdrian Johnson <ajohnson@redneon.com>
Mon, 26 Oct 2009 09:09:16 +0000 (11:09 +0200)
committerTor Lillqvist <tml@iki.fi>
Tue, 27 Oct 2009 10:30:50 +0000 (12:30 +0200)
Fixes bug #381371.

gtk/gtkprintoperation-win32.c

index 3da48cb708b1b051dbeaa47f3f6503446e250094..b7210f0d8bf21539e8e3eca7a33387aaf744487b 100644 (file)
@@ -444,6 +444,7 @@ win32_start_page (GtkPrintOperation *op,
   GtkPrintOperationWin32 *op_win32 = op->priv->platform_data;
   LPDEVMODEW devmode;
   GtkPaperSize *paper_size;
+  double x_off, y_off;
 
   devmode = GlobalLock (op_win32->devmode);
   
@@ -468,6 +469,10 @@ win32_start_page (GtkPrintOperation *op,
   ResetDCW (op_win32->hdc, devmode);
   
   GlobalUnlock (op_win32->devmode);
+
+  x_off = GetDeviceCaps (op_win32->hdc, PHYSICALOFFSETX);
+  y_off = GetDeviceCaps (op_win32->hdc, PHYSICALOFFSETY);
+  cairo_surface_set_device_offset (op_win32->surface, -x_off, -y_off);
   
   StartPage (op_win32->hdc);
 }