From 4711f28867b42d71b5ccc8e9a2fd8219fbd8c91d Mon Sep 17 00:00:00 2001 From: Massimo Valentini Date: Fri, 20 Sep 2013 18:08:55 +0200 Subject: [PATCH] win32: on XP GetClipBox on the root window returns NULLREGION and an empty rect to mean no clip. That does not mean empty surface. On Win7 it returns SIMPLEREGION with the screen size in pixels. This causes, on XP, GIMP's color picker to return always black: https://bugzilla.gnome.org/show_bug.cgi?id=676708 --- src/win32/cairo-win32-display-surface.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/win32/cairo-win32-display-surface.c b/src/win32/cairo-win32-display-surface.c index 8eaacf7..0aa1fc6 100644 --- a/src/win32/cairo-win32-display-surface.c +++ b/src/win32/cairo-win32-display-surface.c @@ -620,6 +620,10 @@ _cairo_win32_save_initial_clip (HDC hdc, cairo_win32_display_surface_t *surface) SetGraphicsMode (hdc, gm); /* XXX: Can we make a more reasonable guess at the error cause here? */ return _cairo_error (CAIRO_STATUS_DEVICE_ERROR); + } else if (clipBoxType == NULLREGION) { + rect.left = rect.top = 0; + rect.right = GetDeviceCaps (hdc, HORZRES); + rect.bottom = GetDeviceCaps (hdc, VERTRES); } surface->win32.extents.x = rect.left; -- 1.7.6.5