<div dir="ltr">I want Invalidate window:<div><div>void invalidate()</div><div>{</div><div>    xcb_expose_event_t invalidate_event;</div><div>    invalidate_event.window = window;</div><div>    invalidate_event.count = 1;</div><div>    invalidate_event.sequence = 0;</div><div>    invalidate_event.response_type = XCB_EXPOSE;</div><div>    invalidate_event.x = 0;</div><div>    invalidate_event.y = 0;</div><div>    invalidate_event.width = WIDTH;</div><div>    invalidate_event.height = HEIGHT;</div><div>    xcb_void_cookie_t evCookie = xcb_send_event_checked(connection, false, window, XCB_EVENT_MASK_EXPOSURE, (char*)&invalidate_event);</div><div>    testCookie(evCookie, connection, "can't send event");</div><div>    xcb_flush(connection);</div><div>}</div></div><div><div>static void testCookie(xcb_void_cookie_t cookie,</div><div>    xcb_connection_t* connection,</div><div>    char* errMessage)</div><div>{</div><div>    xcb_generic_error_t* error = xcb_request_check(connection, cookie);</div><div>    if (error) {</div><div>        fprintf(stderr, "ERROR: %s : %" PRIu8 "\n", errMessage, error->error_code);</div><div>        xcb_disconnect(connection);</div><div>        exit(-1);</div><div>    }</div><div>}</div></div><div><br></div><div><div>testCookie returns me error = 16 = "bad length"</div></div><div>Inimplementation xcb_send_event_checked in xproto.c is </div><div>xcb_parts[4].iov_len = 32 * sizeof(char);<br></div><div>but sizeof(xcb_expose_event_t) = 20, I changed</div><div>xcb_parts[4].iov_len = sizeof(xcb_expose_event_t) <br></div><div>and xcb_out.length = (sizeof(xcb_out)+sizeof(xcb_expose_event_t))/4;</div><div>but still is error 16</div></div>