X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglut%2Fglx%2Fglut_event.c;h=d6d963896a6fff8143f914956e60f4f774eac377;hb=5340b6dff73a0a23531ce2a5f28fba8303adab6e;hp=e453fe038937659b5562bdf340528b70623755b2;hpb=0a363f4e87742680ac9193c3a276f5e93ac6adef;p=mesa.git diff --git a/src/glut/glx/glut_event.c b/src/glut/glx/glut_event.c index e453fe03893..d6d963896a6 100644 --- a/src/glut/glx/glut_event.c +++ b/src/glut/glx/glut_event.c @@ -24,7 +24,7 @@ # ifdef __sgi # include /* prototype for bzero used by FD_ZERO */ # endif -# if (defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE) +# if (defined(__FreeBSD__) || defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE) # include /* select system call interface */ # ifdef luna # include @@ -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; } @@ -438,11 +442,16 @@ processEventsAndTimeouts(void) __glutFinishMenu(event.xbutton.window, event.xbutton.x, event.xbutton.y); } else { window = __glutGetWindow(event.xbutton.window); + /* added button check for mice with > 3 buttons */ if (window) { GLUTmenu *menu; int menuNum; - menuNum = window->menu[event.xbutton.button - 1]; + if (event.xbutton.button <= GLUT_MAX_MENUS) + menuNum = window->menu[event.xbutton.button - 1]; + else + menuNum = 0; + /* Make sure that __glutGetMenuByNum is only called if there really is a menu present. */ if ((menuNum > 0) && (menu = __glutGetMenuByNum(menuNum))) { @@ -1312,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); @@ -1329,9 +1343,7 @@ processWindowWorkList(GLUTwindow * window) } } -#ifndef _WIN32 static /* X11 implementations do not need this global. */ -#endif void __glutProcessWindowWorkLists(void) {