From: Richard Rauch Date: Tue, 23 Dec 2003 08:39:44 +0000 (+0000) Subject: Moved the window-resize code so that it happens whenever there is a X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=65138c495648cd547734c045268e7551bb493bb7;hp=46fdc013410ba2df0ca8bd738f489b1e5bbde8b1;p=freeglut Moved the window-resize code so that it happens whenever there is a pending resize for the window, whether or not the window is visible or in need of a redisplay. The resize is now done before the visibility and need-to-redisplay checks. git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@414 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/freeglut_main.c b/src/freeglut_main.c index 7465ab5..16a6674 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -199,40 +199,25 @@ static void fghRedrawWindowByHandle ( SFG_WindowHandleType handle ) static void fghcbDisplayWindow( SFG_Window *window, SFG_Enumerator *enumerator ) { + if( window->State.NeedToResize ) + { + SFG_Window *current_window = fgStructure.Window; + + fgSetWindow( window ); + + fghReshapeWindowByHandle( + window->Window.Handle, + window->State.Width, + window->State.Height + ); + + window->State.NeedToResize = GL_FALSE; + fgSetWindow( current_window ); + } + if( window->State.Redisplay && window->State.Visible ) { - /* - * XXX Resizing should *not* depend upon whether there - * XXX is a pending redisplay flag, as far as I can tell. - * XXX - * XXX Note, too, that the {NeedToResize} flag is a little - * XXX fuzzy in its meaning, since for WIN32, this also - * XXX means "we need to tell the application that the window has - * XXX changed size", while in X11, it only means "we need - * XXX to ask the window system to resize the window. - * XXX Splitting the flag's meaning might be desirable, but - * XXX that could complicate the code more. (On X11, the - * XXX user callback is called as soon as the event is - * XXX discovered, but resizing the window is postponed - * XXX until after other events.) - */ - if( window->State.NeedToResize ) - { - SFG_Window *current_window = fgStructure.Window; - - fgSetWindow( window ); - - fghReshapeWindowByHandle( - window->Window.Handle, - window->State.Width, - window->State.Height - ); - - window->State.NeedToResize = GL_FALSE; - fgSetWindow ( current_window ); - } - window->State.Redisplay = GL_FALSE; #if TARGET_HOST_UNIX_X11