1
0
xorg-x11-server/p_xnest-ignore-getimage-errors.diff
OBS User autobuild de140e0677 Accepting request 19080 from X11:XOrg
Copy from X11:XOrg/xorg-x11-server based on submit request 19080 from user sndirsch

OBS-URL: https://build.opensuse.org/request/show/19080
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xorg-x11-server?expand=0&rev=138
2009-08-28 18:30:20 +00:00

33 lines
1.1 KiB
Diff

Index: build-GucBkyZ/xorg-server-1.6.3.901/hw/xnest/GCOps.c
===================================================================
--- build-GucBkyZ/xorg-server-1.6.3.901.orig/hw/xnest/GCOps.c
+++ build-GucBkyZ/xorg-server-1.6.3.901/hw/xnest/GCOps.c
@@ -94,6 +94,13 @@ xnestPutImage(DrawablePtr pDrawable, GCP
}
}
+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,
unsigned int format, unsigned long planeMask,
@@ -101,9 +108,13 @@ xnestGetImage(DrawablePtr pDrawable, int
{
XImage *ximage;
int length;
+ int (*old_handler)(Display*, XErrorEvent*);
+ /* 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);
if (ximage) {
length = ximage->bytes_per_line * ximage->height;