void XRecordKeyboardMonitor::processNextReply()
{
    xcb_generic_event_t *event;
    while ((event = xcb_poll_for_event(m_connection))) {
        std::free(event);
    }

    void *reply = 0;
    while (xcb_poll_for_reply(m_connection, m_cookie.sequence, &reply, 0)) {
        if (!reply) {
            continue;
        }

        QScopedPointer<xcb_record_enable_context_reply_t, QScopedPointerPodDeleter>
        data(reinterpret_cast<xcb_record_enable_context_reply_t*>(reply));
        process(data.data());
    }
}
Example #2
0
void XServerPinger::xInput(int)
{
    void *reply;
    xcb_generic_error_t *error;
    xcb_generic_event_t *event;

    // X has sent us something, read it.
    if ((event = xcb_poll_for_event(xcb)) != NULL)
        // Some event, ignore it
        free(event);

    if (request.sequence
        && xcb_poll_for_reply(xcb, request.sequence, &reply, &error)) {
        if (reply) {
            free(reply);
            request.sequence = 0;
        } else if (error)
            // Ignore
            free(error);
    }
}