From 633e3e7179e88d91df1d5391e446a142e148e353 Mon Sep 17 00:00:00 2001 From: spanne Date: Wed, 6 Jul 2005 16:11:31 +0000 Subject: [PATCH] We only have pending redisplay callbacks when the window wants to be redisplayed *and* it is visible. Otherwise we won't redraw, anyway, and immediately discover that there's still something to do, etc. etc., leading to 100% CPU load. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@670 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/ChangeLog | 5 +++++ freeglut/freeglut/src/freeglut_main.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/freeglut/freeglut/ChangeLog b/freeglut/freeglut/ChangeLog index e90f285..f1e6bb7 100644 --- a/freeglut/freeglut/ChangeLog +++ b/freeglut/freeglut/ChangeLog @@ -1105,3 +1105,8 @@ deinitializing. The visual/context handling for menus is still rather obscure, though... (287) Removed redundant code. + +(288) We only have pending redisplay callbacks when the window wants to be +redisplayed *and* it is visible. Otherwise we won't redraw, anyway, and +immediately discover that there's still something to do, etc. etc., leading +to 100% CPU load. diff --git a/freeglut/freeglut/src/freeglut_main.c b/freeglut/freeglut/src/freeglut_main.c index a953316..8ade92b 100644 --- a/freeglut/freeglut/src/freeglut_main.c +++ b/freeglut/freeglut/src/freeglut_main.c @@ -413,7 +413,7 @@ static int fghHaveJoystick( void ) } static void fghHavePendingRedisplaysCallback( SFG_Window* w, SFG_Enumerator* e) { - if( w->State.Redisplay ) + if( w->State.Redisplay && w->State.Visible ) { e->found = GL_TRUE; e->data = w;