glx: fix querying GLX_FBCONFIG_ID for bare Window
This commit fixes apps using the following sequence:
- XCreateWindow(dpy) -> win
- glXCreateContextAttribsARB(dpy, ...) -> ctx
- glXMakeCurrent(dpy, win, ctx)
- 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.