From cae4a8fc7d4c9967e74d6c6763249f93097c6bfb Mon Sep 17 00:00:00 2001 From: Boram Park Date: Tue, 16 Dec 2014 13:01:20 +0900 Subject: [PATCH] Xlib/XCB: passing the error in xreply to the extension who sent the request. 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. Change-Id: I5621d637ca41361b7dfab9910a52951fec47f093 Signed-off-by: Boram Park --- 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 727c6c7..bfc3fc3 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; -- 2.7.4