diff --git a/freeglut/freeglut/src/freeglut_main.c b/freeglut/freeglut/src/freeglut_main.c index 34e284b..6935ff1 100644 --- a/freeglut/freeglut/src/freeglut_main.c +++ b/freeglut/freeglut/src/freeglut_main.c @@ -1214,11 +1214,16 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, case WM_SIZE: /* - * We got resized... But check if the window has been already added... + * If the window is visible, then it is the user manually resizing it. + * If it is not, then it is the system sending us a dummy resize with + * zero dimensions on a "glutIconifyWindow" call. */ - window->State.NeedToResize = GL_TRUE; - window->State.Width = LOWORD(lParam); - window->State.Height = HIWORD(lParam); + if( window->State.Visible ) + { + window->State.NeedToResize = GL_TRUE; + window->State.Width = LOWORD(lParam); + window->State.Height = HIWORD(lParam); + } break; #if 0 case WM_SETFOCUS: diff --git a/freeglut/freeglut/src/freeglut_window.c b/freeglut/freeglut/src/freeglut_window.c index c92fbcb..12e6b52 100644 --- a/freeglut/freeglut/src/freeglut_window.c +++ b/freeglut/freeglut/src/freeglut_window.c @@ -719,6 +719,8 @@ void FGAPIENTRY glutIconifyWindow( void ) freeglut_assert_ready; freeglut_assert_window; + fgStructure.Window->State.Visible = GL_FALSE; + #if TARGET_HOST_UNIX_X11 XIconifyWindow( fgDisplay.Display, fgStructure.Window->Window.Handle,