summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2009-07-23 21:53:46 +0200
committerAlexander Larsson <alexl@redhat.com>2009-07-23 22:03:15 +0200
commit9d69355e6f000ba2b8c7ae8897a04f3d6c8c19da (patch)
tree6d9fa430594b1410009f082c4413e59fa7aa0b17
parente71c5d3ab544466754bb1b85358186e8d7e7b9f9 (diff)
downloadgdk-pixbuf-9d69355e6f000ba2b8c7ae8897a04f3d6c8c19da.tar.gz
Fix clipping of pixbuf drawing to windows
When the fallback for gdk_draw_pixbuf (gdk_drawable_real_draw_pixbuf) is called with a window destination we have already applied any clip regions and offsets for the window, but the window we get is a wrapper and not an impl. We have to ensure we really draw to the impl, as otherwise the pixbuf drawing will be clipped by client side subwindows. This fixes bug 588553.
-rw-r--r--gdk/gdkdraw.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c
index 44652bcbe..714753083 100644
--- a/gdk/gdkdraw.c
+++ b/gdk/gdkdraw.c
@@ -1525,6 +1525,7 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
GdkRegion *clip;
GdkRegion *drect;
GdkRectangle tmp_rect;
+ GdkDrawable *real_drawable;
g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
g_return_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB);
@@ -1597,6 +1598,16 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
/* Actually draw */
if (!gc)
gc = _gdk_drawable_get_scratch_gc (drawable, FALSE);
+
+ /* Drawable is a wrapper here, but at this time we
+ have already retargeted the destination to any
+ impl window and set the clip, so what we really
+ want to do is draw directly on the impl, ignoring
+ client side subwindows. */
+ if (GDK_IS_WINDOW (drawable))
+ real_drawable = GDK_WINDOW_OBJECT (drawable)->impl;
+ else
+ real_drawable = drawable;
if (pixbuf->has_alpha)
{
@@ -1667,7 +1678,7 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
image->bpl,
visual->byte_order,
width1, height1);
- gdk_draw_image (drawable, gc, image,
+ gdk_draw_image (real_drawable, gc, image,
xs0, ys0,
dest_x + x0, dest_y + y0,
width1, height1);
@@ -1708,7 +1719,7 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
{
guchar *buf = pixbuf->pixels + src_y * pixbuf->rowstride + src_x * 4;
- gdk_draw_rgb_32_image_dithalign (drawable, gc,
+ gdk_draw_rgb_32_image_dithalign (real_drawable, gc,
dest_x, dest_y,
width, height,
dither,
@@ -1719,7 +1730,7 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
{
guchar *buf = pixbuf->pixels + src_y * pixbuf->rowstride + src_x * 3;
- gdk_draw_rgb_image_dithalign (drawable, gc,
+ gdk_draw_rgb_image_dithalign (real_drawable, gc,
dest_x, dest_y,
width, height,
dither,