X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_main.c;h=c28658f35bd795f94307f1c79ade3dcd476be85c;hb=8756c552d99adeed03a7bdd7c8b0da8c77f5c475;hp=c6eaa64baf48510a3c97c01c2d71c4375dfc804e;hpb=fa43a255b9778016ce78123712b8ff89efd2fb34;p=freeglut diff --git a/src/freeglut_main.c b/src/freeglut_main.c index c6eaa64..c28658f 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -568,12 +568,6 @@ void FGAPIENTRY glutMainLoopEvent( void ) */ switch( event.type ) { - case CreateNotify: - /* - * The window creation confirmation - */ - break; - case DestroyNotify: /* * This is sent to confirm the XDestroyWindow call. @@ -619,6 +613,19 @@ void FGAPIENTRY glutMainLoopEvent( void ) fghRedrawWindowByHandle( event.xexpose.window ); break; + /* + * CreateNotify causes a configure-event so that sub-windows are + * handled compatibly with GLUT. + * + * NOTE that it is possible that you will more than one Reshape + * event for your top-level window, but something like this appears + * to be required for compatbility. + * + * GLUT presumably does this because it generally tries to treat + * sub-windows the same as windows. + * + */ + case CreateNotify: case ConfigureNotify: /* * The window gets resized @@ -865,7 +872,7 @@ void FGAPIENTRY glutMainLoopEvent( void ) SFG_Window *save_window = fgStructure.Window ; SFG_Menu *save_menu = fgStructure.Menu ; SFG_Window *parent_window = window->ActiveMenu->ParentWindow ; - fgSetWindow ( window ) ; + fgSetWindow ( parent_window ) ; fgStructure.Menu = window->ActiveMenu ; /* Execute the menu callback */ @@ -1643,7 +1650,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara SFG_Window *save_window = fgStructure.Window ; SFG_Menu *save_menu = fgStructure.Menu ; SFG_Window *parent_window = window->ActiveMenu->ParentWindow ; - fgSetWindow ( window ) ; + fgSetWindow ( parent_window ) ; fgStructure.Menu = window->ActiveMenu ; /* Execute the menu callback */