Bug#329596: this bug still exists

Zach Miller zachatwork at gmail.com
Mon Nov 24 00:33:47 UTC 2008


I poked through the code and found where the problem is occurring but
I don't know enough about the code to know the best approach to
patching it.

The code I poked through is from sid's gnome-utils_2.20.0.1-3.

In screenshot-utils.c in function screenshot_get_pixbuf() starting at
line 526 there is this:

  tmp = gdk_pixbuf_get_from_drawable (NULL, root, NULL,
				      x_orig, y_orig, 0, 0,
				      width, height);

  rectangles = XShapeGetRectangles (GDK_DISPLAY (), GDK_WINDOW_XWINDOW (window),
				    ShapeBounding, &rectangle_count, &rectangle_order);
  if (rectangle_count > 0)
    {
.... lots of lines ....
    }
  else
    {
      screenshot = tmp;
    }

On my 3-screen xinerama system (described above) when taking a
screenshot of the root window, the rectangle_count here is 1 so the
conditional evaluates to true. However, rectangles[0].width is 1680
(which is the width of my Screen0, not the width of my entire xinerama
display). Consequently the following code which copies the image data
from the sole rectangle into the pixbuf only copies the leftmost 1680
pixels, rather than the whole display. Is it a bug in
XShapeGetRectangles() that it returns a single rectangle with the
dimensions of Screen0 when called on the root window? Or is it a bug
in how gnome-screenshot is using this function?

If I change the conditional to if(0) and just let screenshot = tmp,
skipping over all the special rectangle handling, the screenshot works
perfectly.

I don't know the purpose of the special rectangle handling so I can't
suggest a patch that I'm sure wouldn't break other cases but I'm sure
someone upstream knows what to do about this!






More information about the pkg-gnome-maintainers mailing list