[PATCH libX11] Xlib/XCB: passing the error in xreply to the extension who sent the request.

Boram Park boram1288.park at samsung.com
Mon Dec 15 21:25:54 PST 2014


   The error in x-reply is the result of x client's request of one
   of the extensions. In this case, the error must be handled by
   the extension who sent the request.

Signed-off-by: Boram Park <boram1288.park at samsung.com>
---
 src/xcb_io.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/xcb_io.c b/src/xcb_io.c
index 5987329..ab81a33 100644
--- a/src/xcb_io.c
+++ b/src/xcb_io.c
@@ -203,12 +203,13 @@ static int handle_error(Display *dpy, xError *err, Bool in_XReply)
 	/* Oddly, Xlib only allows extensions to suppress errors when
 	 * those errors were seen by _XReply. */
 	if(in_XReply)
-		/*
-		 * we better see if there is an extension who may
-		 * want to suppress the error.
+		/* The error in x-reply is the result of x client's request of one
+		 * of the extensions. In this case, the error must be handled by
+		 * the extension who sent the request.
 		 */
 		for(ext = dpy->ext_procs; ext; ext = ext->next)
-			if(ext->error && (*ext->error)(dpy, err, &ext->codes, &ret_code))
+			if(err->majorCode == ext->codes.major_opcode &&
+			   ext->error && (*ext->error)(dpy, err, &ext->codes, &ret_code))
 				return ret_code;
 	_XError(dpy, err);
 	return 0;
-- 
1.7.9.5



More information about the xorg-devel mailing list