From: Carl Worth <cworth@cworth.org>
Date: Tue, 27 Aug 2013 20:14:53 +0000 (-0700)
Subject: glxwrap: Initialize fips_dispatch when glxMakeContextCurrent is called
X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=5169acf1de805f8ad277554f6ec064e8f36111c3;p=fips

glxwrap: Initialize fips_dispatch when glxMakeContextCurrent is called

Previously, we only intitialized fips_dispatch if glxMakeCurrent was
called.  This caused fips to fail for programs that called
glxMakeContextCurrent instead. Both functions are now handled
indentically, (giving fips a clear indication that GLX is being used,
not EGL).

This fixes the failure of fips with Lightsmark 2008.
---

diff --git a/glxwrap.c b/glxwrap.c
index cccc05f..59d3e8e 100644
--- a/glxwrap.c
+++ b/glxwrap.c
@@ -86,3 +86,15 @@ glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx)
 
 	return ret;
 }
+
+Bool
+glXMakeContextCurrent (Display *dpy, GLXDrawable drawable, GLXDrawable read, GLXContext ctx)
+{
+	Bool ret;
+
+	fips_dispatch_init (FIPS_API_GLX);
+
+	GLWRAP_DEFER_WITH_RETURN (ret, glXMakeContextCurrent, dpy, drawable, read, ctx);
+
+	return ret;
+}