Skip to content

glx: fix querying GLX_FBCONFIG_ID for bare Window

This commit fixes apps using the following sequence:

  1. XCreateWindow(dpy) -> win
  2. glXCreateContextAttribsARB(dpy, ...) -> ctx
  3. glXMakeCurrent(dpy, win, ctx)
  4. glXQueryDrawable(dpy, win, GLX_FBCONFIG_ID, ...)

glXQueryDrawable returned 0 (while correctly returning a valid GLXFCONFIG_ID for other types of drawables).

This commit adds the same dance as driInferDrawableConfig to get the GLX visual from the Window, and then the GLXFBCONFIG_ID of this visual.

This fixes:

  • piglit: glx-query-drawable --attr=GLX_FBCONFIG_ID --type=WINDOW
  • Maya which uses the config ID from step 4 as an input to glXChooseFBConfig.

Merge request reports