Merge commit 'origin/gallium-master-merge'
[mesa.git] / src / glut / glx / glut_event.c
index 0a96e8cf71de932b5229a8051bd821c4aa511c0f..d6d963896a6fff8143f914956e60f4f774eac377 100644 (file)
@@ -172,10 +172,14 @@ handleTimeouts(void)
   GETTIMEOFDAY(&now);
   while (IS_AT_OR_AFTER(__glutTimerList->timeout, now)) {
     timer = __glutTimerList;
-    __glutTimerList = timer->next;
+    /* call the timer function */
     timer->func(timer->value);
+    /* remove from the linked list */
+    __glutTimerList = timer->next;
+    /* put this timer on the "free" list */
     timer->next = freeTimerList;
     freeTimerList = timer;
+
     if (!__glutTimerList)
       break;
   }
@@ -1317,7 +1321,12 @@ processWindowWorkList(GLUTwindow * window)
        is where the finish works gets queued for indirect
        contexts. */
     __glutSetWindow(window);
-    glFinish();
+#if !defined(_WIN32)
+    if (!window->isDirect)
+#endif
+    {
+       glFinish();
+    }
   }
   if (workMask & GLUT_DEBUG_WORK) {
     __glutSetWindow(window);
@@ -1334,9 +1343,7 @@ processWindowWorkList(GLUTwindow * window)
   }
 }
 
-#ifndef _WIN32
 static  /* X11 implementations do not need this global. */
-#endif
 void
 __glutProcessWindowWorkLists(void)
 {