Xlib/XCB: passing the error in xreply to the extension who sent the request. 37/32137/1 accepted/tizen_common accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable tizen tizen_3.0.2014.q4_common tizen_3.0.2015.q1_common tizen_3.0.2015.q2_common accepted/tizen/common/20141218.123229 accepted/tizen/mobile/20141219.011532 accepted/tizen/tv/20141219.011330 accepted/tizen/wearable/20141219.011447 submit/tizen_common/20141216.071312 submit/tizen_mobile/20141216.071329 submit/tizen_tv/20141216.071321 submit/tizen_wearable/20141216.071337
authorBoram Park <boram1288.park@samsung.com>
Tue, 16 Dec 2014 04:01:20 +0000 (13:01 +0900)
committerBoram Park <boram1288.park@samsung.com>
Tue, 16 Dec 2014 06:09:35 +0000 (15:09 +0900)
   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 <boram1288.park@samsung.com>
src/xcb_io.c

index 727c6c7..bfc3fc3 100644 (file)
@@ -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;