[Xcb] problem with the use of the shm extension

Vincent Torri Vincent.Torri at iecn.u-nancy.fr
Sun Oct 2 05:34:54 PDT 2005



On Sat, 1 Oct 2005, Jamey Sharp wrote:

> On Sat, 2005-10-01 at 09:44 +0200, Vincent Torri wrote:
> > I've seen that there's XCBShmInit in shm.h, but I don't know how to use
> > it. Its call does not solve the problem. Should I do sommething with its
> > reply ?
> >
> > On Sat, 1 Oct 2005, Vincent Torri wrote:
> > > I get this error message :
> > >
> > > ecore_evas_test: xcb_out.c:109: XCBSendRequest: Assertion `extension &&
> > > extension->present' failed.
>
> This error means that your X server doesn't have MIT-SHM. Have you
> checked that with xdpyinfo?
>

no I haven't. But's i've run the program in Xnest, which maybe does not
support the extension.

> The *Init calls are slated to go away since they're easy to implement by
> calling other functions. You should include the equivalent code in the
> initialization of your program, though:
>
> const XCBQueryExtensionRep *r = XCBGetExtensionData(c, &XCBSHMId);

ok, I use that.

> Then you can test both that r is not null (which would indicate some
> sort of serious error) and that r->present is true. If r->present is
> false, then the extension is not supported and you need to not use it
> with that connection.

ok

> As the documentation for XCBGetExtensionData will tell you, don't free r
> when you're done with it. This is the only XCB*Rep pointer that you're
> not supposed to free. :-)

ok

> Note that XCBGetExtensionData caches its results, so you can call it
> multiple times without a performance penalty. For best performance,
> though, you should call XCBPrefetchExtensionData for all of the
> extensions you want to use first, and then later call
> XCBGetExtensionData as needed.

haa, interesting :) It will be useful for ecore, which has to initialize
all the extensions it finds.

> Your question points out a "bug" in XCB: having this error case result
> in an assertion failure is kind of dumb. I've been trying to figure out
> how to report this kind of error for a few years now, though, and
> haven't got it yet. At the least I suppose it's a documentation bug.

:) At least, I have found out that I have not use XCBGetExtensionData in
evas, so it's a good message :)

thank you

Vincent


More information about the Xcb mailing list