[Xcb] glXCreateWindow doesn't work when VISUAL_ID and screen->root_visual aren't equal

Peter Harris git at peter.is-a-geek.org
Sat Jun 16 19:24:59 PDT 2012

On Sat, Jun 16, 2012 at 7:46 PM, Pubby Eight wrote:
> I'm working on code very similar to this:
> http://xcb.freedesktop.org/opengl/
> It works fine when I use the default framebuffer configuration, although
> when I try to query a certain one it fails. I've determined that it fails
> whenever  VISUAL_ID (visualID in the example code) and
> screen->root_visual are different values.

> Here is the error message:
> X Error of failed request:  BadWindow (invalid Window parameter)

> What can I do to fix this?

Without your actual code, I can't say for certain. At a guess, your
prior xcb_create_window is returning BadMatch (and the error isn't
being reported for some unrelated reason) so the window doesn't exist.

The most common causes of a window not being created when you change
the visual ID are: not setting a new background pixel, not setting a
new border pixel (mandatory even when the border width is zero), and
not setting a new colormap that matches the visual (mandatory even on
TrueColor, despite the server not using the colormap for much of

I hope this helps. If not, please share your code so we have something
other than guesses to work with.

Peter Harris

More information about the Xcb mailing list