[Xcb] XShmGetEventBase()

Peter Harris pharris at opentext.com
Tue May 19 08:09:55 PDT 2009


Russell Shaw wrote:
> Hi,
> How do i get XCB events for X extensions? I'm trying to figure out the
> equivalent of:
> 
> 
>    #include<X11/extensions/XShm.h>
> 
>    XEvent xevent;
>    XNextEvent(app->display, &xevent);
> 
>    int ShmCompletiontype = XShmGetEventBase(Display) + ShmCompletion;
> 
>    if(xevent.type == ShmCompletiontype) {

#include <xcb/shm.h>

xcb_generic_event_t *xevent;
xcb_flush(Display);
xevent = xcb_wait_for_event(Display);

int ShmCompletiontype = xcb_get_extension_data(Display,
&xcb_shm_id)->first_event + XCB_SHM_COMPLETION;

if (xevent->response_type == ShmCompletiontype) {
    ...
}
free(xevent);

Peter Harris

(Sorry for the delayed response. It was a long weekend up here in Canada)
-- 
               Open Text Connectivity Solutions Group
Peter Harris                    http://www.opentext.com/connectivity
Research and Development        Phone: +1 905 762 6001
pharris at opentext.com            Toll Free: 1 877 359 4866


More information about the Xcb mailing list