[PATCH] Add xoff and yoff to drawable->x and drawable->y in create_bits_picture().

Soeren Sandmann sandmann at daimi.au.dk
Thu Sep 10 19:03:06 PDT 2009


Emacs crashes if you run it on a composited desktop without render acceleration.

I'll push to both 1.7 and master unless there are objections.

Soren



commit a9ba24ef7d5153abe2684927de5be23ad7b50735
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Thu Sep 10 21:42:42 2009 -0400

    Add xoff and yoff to drawable->x and drawable->y in create_bits_picture().
    
    These are 0, except when the drawable is a redirected window.

diff --git a/fb/fbpict.c b/fb/fbpict.c
index dd9cefe..2fbef15 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -336,7 +336,9 @@ create_bits_picture (PicturePtr pict,
     
     fbGetDrawable (drawable, bits, stride, bpp, xoff, yoff);
 
-    bits = (FbBits*)((CARD8*)bits + drawable->y * stride * sizeof(FbBits) + drawable->x * (bpp / 8));
+    bits = (FbBits*)((CARD8*)bits +
+		     (drawable->y + yoff) * stride * sizeof(FbBits) +
+		     (drawable->x + xoff) * (bpp / 8));
 
     image = pixman_image_create_bits (
 	pict->format, drawable->width, drawable->height,


More information about the xorg-devel mailing list