aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx/glxext.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/glx/glxext.c')
-rw-r--r--xorg-server/glx/glxext.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c
index a1f9d42e9..83b85e7c0 100644
--- a/xorg-server/glx/glxext.c
+++ b/xorg-server/glx/glxext.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <string.h>
@@ -45,6 +49,9 @@
#include "glxext.h"
#include "indirect_table.h"
#include "indirect_util.h"
+#include "glapi.h"
+
+extern void FlushContext(__GLXcontext *cx);
/*
** The last context used by the server. It is the context that is current
@@ -138,6 +145,8 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid)
for (c = glxAllContexts; c; c = next) {
next = c->next;
if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
+ if (GET_DISPATCH()) FlushContext(c); /* Only flush if we still have a context */
+
(*c->loseCurrent) (c);
c->isCurrent = GL_FALSE;
if (c == __glXLastContext)
@@ -323,15 +332,9 @@ GlxExtensionInit(void)
ExtensionEntry *extEntry;
ScreenPtr pScreen;
int i;
- __GLXprovider *p, **stack;
+ __GLXprovider *p;
Bool glx_provided = False;
-
- if (serverGeneration == 1) {
- for (stack = &__glXProviderStack; *stack; stack = &(*stack)->next)
- ;
- *stack = &__glXDRISWRastProvider;
- }
-
+
__glXContextRes = CreateNewResourceType((DeleteType) ContextGone,
"GLXContext");
__glXDrawableRes = CreateNewResourceType((DeleteType) DrawableGone,
@@ -340,7 +343,10 @@ GlxExtensionInit(void)
return;
if (serverGeneration == 1)
+ {
GlxPushProvider(&__glXDRISWRastProvider);
+ glxWinPushNativeProvider();
+ }
if (!dixRegisterPrivateKey
(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState)))
@@ -441,7 +447,7 @@ __glXForceCurrent(__GLXclientState * cl, GLXContextTag tag, int *error)
if (cx->wait && (*cx->wait) (cx, cl, error))
return NULL;
- if (cx == __glXLastContext) {
+ if (cx == __glXLastContext && GET_DISPATCH()) {
/* No need to re-bind */
return cx;
}