summaryrefslogtreecommitdiff
path: root/gtk/gtkprintoperation-win32.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2009-10-26 11:09:16 +0200
committerTor Lillqvist <tml@iki.fi>2009-10-27 12:30:50 +0200
commit9f2c5e3b3a1f1cf8f4c4cd15f1e4ca84cf998267 (patch)
tree237dc5acac32108606903c8972d6e070c973358d /gtk/gtkprintoperation-win32.c
parent57af1cdb8caad86719b6f56d5026c12c7de52464 (diff)
downloadgtk+-9f2c5e3b3a1f1cf8f4c4cd15f1e4ca84cf998267.tar.gz
Take printer margins into account on Windows
Fixes bug #381371.
Diffstat (limited to 'gtk/gtkprintoperation-win32.c')
-rw-r--r--gtk/gtkprintoperation-win32.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtkprintoperation-win32.c b/gtk/gtkprintoperation-win32.c
index 3da48cb708..b7210f0d8b 100644
--- a/gtk/gtkprintoperation-win32.c
+++ b/gtk/gtkprintoperation-win32.c
@@ -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);
}