2012-04-20 11:32:05 +02:00
|
|
|
Index: xorg-server-1.12.1/hw/xnest/GCOps.c
|
|
|
|
===================================================================
|
|
|
|
--- xorg-server-1.12.1.orig/hw/xnest/GCOps.c
|
|
|
|
+++ xorg-server-1.12.1/hw/xnest/GCOps.c
|
|
|
|
@@ -94,15 +94,26 @@ xnestPutImage(DrawablePtr pDrawable, GCP
|
|
|
|
}
|
2006-12-18 15:48:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
+static int
|
|
|
|
+xnestIgnoreErrorHandler (Display *display,
|
|
|
|
+ XErrorEvent *event)
|
|
|
|
+{
|
|
|
|
+ return False; /* return value is ignored */
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
void
|
|
|
|
xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
|
2012-04-20 11:32:05 +02:00
|
|
|
unsigned int format, unsigned long planeMask, char *pImage)
|
2006-12-18 15:48:26 +01:00
|
|
|
{
|
2012-04-20 11:32:05 +02:00
|
|
|
XImage *ximage;
|
|
|
|
int length;
|
|
|
|
+ int (*old_handler)(Display*, XErrorEvent*);
|
2006-12-18 15:48:26 +01:00
|
|
|
|
2012-04-20 11:32:05 +02:00
|
|
|
+ /* we may get BadMatch error when xnest window is minimized */
|
|
|
|
+ old_handler = XSetErrorHandler (xnestIgnoreErrorHandler);
|
|
|
|
ximage = XGetImage(xnestDisplay, xnestDrawable(pDrawable),
|
|
|
|
x, y, w, h, planeMask, format);
|
|
|
|
+ XSetErrorHandler (old_handler);
|
2006-12-18 15:48:26 +01:00
|
|
|
|
2012-04-20 11:32:05 +02:00
|
|
|
if (ximage) {
|
|
|
|
length = ximage->bytes_per_line * ximage->height;
|