[Xcb] xlib - xcb question

Peter Hutterer mailinglists at who-t.net
Mon Dec 4 19:49:46 PST 2006


Hey guys,

A quick question:
I have an Xlib program that I would like to intermix with xcb.
Reason being I need to use a new X extension for which no Xlib  
implementation exists. There is a XCB extension though.

So my thoughts were that I could use libX11-xcb, get the  
xcb_connection_t using XGetXCBConnection() and then just port the  
event loop over.

The old code looks like this
========
XEvent ev;
XNextEvent(dpy, &ev);
switch(ev.type)
{
    case foo:
	handleFooEvent(ev);
	break;
}
========

XCB code should be something like this
========
xcb_generic_event_t* ev;
ev = xcb_wait_for_event(c);
switch(ev->response_type)
{
	case foo:
	handleXCBFooEvent(ev);
	break;
}
========

The rest of the code should stay the same.
The problem is that except for some extension events (of the  
extension without Xlib) I am not actually getting any events, neither  
expose, nor anything else.

So the question is: am I forgetting something here?


Cheers,
   Peter

--
Multi-Pointer X Server
http://wearables.unisa.edu.au/mpx




More information about the Xcb mailing list