summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2007-11-05 17:02:03 -0500
committerKristian Høgsberg <[email protected]>2007-11-05 17:02:29 -0500
commit8e66c3d7552bf33163bb8ac2a6d3963bad1b0eb4 (patch)
treebc778d6cb1080c857f3042c16879ce7e16a5bd6b /src
parente2c2df5c23fe718d319cf59ba91eea7abc0455b6 (diff)
Lookup visual in visual list, not fbconfig list.
Also, handle visual not found error case by throwing X error.
Diffstat (limited to 'src')
-rw-r--r--src/glx/x11/glxcmds.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c
index 37bfc2a67cf..cbc566e917a 100644
--- a/src/glx/x11/glxcmds.c
+++ b/src/glx/x11/glxcmds.c
@@ -379,17 +379,21 @@ CreateContext(Display *dpy, XVisualInfo *vis,
const __GLcontextModes * mode;
drm_context_t hwContext;
- /* The value of fbconfig cannot change because it is tested
- * later in the function.
- */
- if ( fbconfig == NULL ) {
- /* FIXME: Is it possible for the __GLcontextModes structure
- * FIXME: to not be found?
- */
- mode = _gl_context_modes_find_visual( psc->configs,
- vis->visualid );
- assert( mode != NULL );
- assert( mode->screen == screen );
+
+ if (fbconfig == NULL) {
+ mode = _gl_context_modes_find_visual(psc->visuals, vis->visualid);
+ if (mode == NULL) {
+ xError error;
+
+ error.errorCode = BadValue;
+ error.resourceID = vis->visualid;
+ error.sequenceNumber = dpy->request;
+ error.type = X_Error;
+ error.majorCode = gc->majorOpcode;
+ error.minorCode = X_GLXCreateContext;
+ _XError(dpy, &error);
+ return None;
+ }
}
else {
mode = fbconfig;