~ubuntu-branches/ubuntu/karmic/xorg-server/karmic-proposed

« back to all changes in this revision

Viewing changes to debian/patches/179_glx_cleanup_drawables.patch

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-08-03 07:55:12 UTC
  • Revision ID: james.westby@ubuntu.com-20090803075512-zgirlr97zwjbbyar
Tags: 2:1.6.2.901-1ubuntu2
* Add 178_glx_flush_cache.patch and 179_glx_cleanup_drawables.patch:
  - Cleanup destroyed windows and drawables, to prevent crash during
    compiz startup.
    (LP: #408293)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
commit 3020b1d43e34fca08cd51f7c7c8ed51497d49ef3
 
2
Author: Michel Dänzer <daenzer@vmware.com>
 
3
Date:   Tue Jun 23 16:45:40 2009 +0200
 
4
 
 
5
    glx: Clean up more thoroughly if the drawable of a current context goes away.
 
6
    
 
7
    Fixes crash when restarting compiz, due to cl->currentContexts[x] being stale.
 
8
 
 
9
diff --git a/glx/glxext.c b/glx/glxext.c
 
10
index 520eb2e..a571ec9 100644
 
11
--- a/glx/glxext.c
 
12
+++ b/glx/glxext.c
 
13
@@ -128,8 +128,31 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
 
14
 
 
15
     for (c = glxAllContexts; c; c = c->next) {
 
16
        if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
 
17
+           int i;
 
18
+
 
19
            (*c->loseCurrent)(c);
 
20
-           __glXFlushContextCache();
 
21
+           c->isCurrent = GL_FALSE;
 
22
+           if (c == __glXLastContext)
 
23
+               __glXFlushContextCache();
 
24
+
 
25
+           for (i = 1; i < currentMaxClients; i++) {
 
26
+               if (clients[i]) {
 
27
+                   __GLXclientState *cl = glxGetClient(clients[i]);
 
28
+
 
29
+                   if (cl->inUse) {
 
30
+                       int j;
 
31
+
 
32
+                       for (j = 0; j < cl->numCurrentContexts; j++) {
 
33
+                           if (cl->currentContexts[j] == c)
 
34
+                               cl->currentContexts[j] = NULL;
 
35
+                       }
 
36
+                   }
 
37
+               }
 
38
+           }
 
39
+
 
40
+           if (!c->idExists) {
 
41
+               __glXFreeContext(c);
 
42
+           }
 
43
        }
 
44
        if (c->drawPriv == glxPriv)
 
45
            c->drawPriv = NULL;