glx: Clarify *why* we need the dummy window
authorEmmanuele Bassi <ebassi@linux.intel.com>
Thu, 4 Feb 2010 13:59:39 +0000 (13:59 +0000)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Thu, 4 Feb 2010 13:59:39 +0000 (13:59 +0000)
The reason why we have a dummy, offscreen Window when we create the
GLX context is that GLX does not like it when you ask the context for
features if it's not made current to a Drawable. Maybe in the future
it will allow us to do so, but right now we have to make do with what
GLX offers us.

clutter/glx/clutter-backend-glx.c

index f32dc41..1a8b28f 100644 (file)
@@ -519,6 +519,12 @@ clutter_backend_glx_create_context (ClutterBackend  *backend,
    * to make sure that a GLX context exists and is made current, we use
    * a dummy, offscreen override-redirect window to which we can always
    * fall back if no stage is available
+   *
+   * XXX - we need to do this dance because GLX does not allow creating
+   * a context and querying it for basic information (even the function
+   * pointers) unless it's made current to a real Drawable. it should be
+   * possible to avoid this in future releases of Mesa and X11, but right
+   * now this is the best solution available.
    */
   xvisinfo = glXGetVisualFromFBConfig (xdisplay, config);
   if (xvisinfo == None)