grab the server during composite rendering compgl compgl
authorDana Jansens <danakj@orodu.net>
Sat, 9 Feb 2008 09:12:32 +0000 (04:12 -0500)
committerDana Jansens <danakj@orodu.net>
Sat, 9 Feb 2008 09:15:58 +0000 (04:15 -0500)
loco/paint.c
loco/window.c

index dc87f08..aca112d 100644 (file)
@@ -59,6 +59,9 @@ void paint_everything(LocoScreen *sc)
     int ret;
     LocoList *it;
 
+    XGrabServer(obt_display);
+    XSync(obt_display, FALSE);
+
     /* XXX if (full_redraw_required) */
         glClear(GL_COLOR_BUFFER_BIT);
 
@@ -98,5 +101,7 @@ void paint_everything(LocoScreen *sc)
     }
     glXSwapBuffers(obt_display, sc->overlay);
 
+    XUngrabServer(obt_display);
+
     loco_screen_redraw_done(sc);
 }
index 7f07225..9585ba5 100644 (file)
@@ -184,12 +184,8 @@ static void pixmap_create(LocoWindow *lw)
     if (lw->pixmap) return;
 
     /* make sure the window exists */
-    XGrabServer(obt_display);
-    XSync(obt_display, FALSE);
-
     if (!XCheckIfEvent(obt_display, &ce, look_for_destroy, (XPointer)&lw->id))
         lw->pixmap = XCompositeNameWindowPixmap(obt_display, lw->id);
-    XUngrabServer(obt_display);
 }
 
 static void texture_create(LocoWindow *lw)
@@ -201,8 +197,7 @@ static void texture_create(LocoWindow *lw)
     };
 
     if (lw->glpixmap) return;
-
-    g_assert(lw->pixmap);
+    if (!lw->pixmap) return;
 
     if (!lw->screen->glxFBConfig[lw->depth]) {
         g_print("no glxFBConfig for depth %d for window 0x%lx\n",