[Xcb] I can't send XCB_EXPOSE event
Andrzej Borucki
borucki.andrzej at gmail.com
Wed Dec 9 01:41:12 PST 2015
I want Invalidate window:
void invalidate()
{
xcb_expose_event_t invalidate_event;
invalidate_event.window = window;
invalidate_event.count = 1;
invalidate_event.sequence = 0;
invalidate_event.response_type = XCB_EXPOSE;
invalidate_event.x = 0;
invalidate_event.y = 0;
invalidate_event.width = WIDTH;
invalidate_event.height = HEIGHT;
xcb_void_cookie_t evCookie = xcb_send_event_checked(connection, false,
window, XCB_EVENT_MASK_EXPOSURE, (char*)&invalidate_event);
testCookie(evCookie, connection, "can't send event");
xcb_flush(connection);
}
static void testCookie(xcb_void_cookie_t cookie,
xcb_connection_t* connection,
char* errMessage)
{
xcb_generic_error_t* error = xcb_request_check(connection, cookie);
if (error) {
fprintf(stderr, "ERROR: %s : %" PRIu8 "\n", errMessage,
error->error_code);
xcb_disconnect(connection);
exit(-1);
}
}
testCookie returns me error = 16 = "bad length"
Inimplementation xcb_send_event_checked in xproto.c is
xcb_parts[4].iov_len = 32 * sizeof(char);
but sizeof(xcb_expose_event_t) = 20, I changed
xcb_parts[4].iov_len = sizeof(xcb_expose_event_t)
and xcb_out.length = (sizeof(xcb_out)+sizeof(xcb_expose_event_t))/4;
but still is error 16
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20151209/98e8d1cf/attachment.html>
More information about the Xcb
mailing list