From: <fa...@us...> - 2011-01-25 05:56:44
|
Revision: 891 http://freeglut.svn.sourceforge.net/freeglut/?rev=891&view=rev Author: fayjf Date: 2011-01-25 05:56:38 +0000 (Tue, 25 Jan 2011) Log Message: ----------- Fixing bug 3048705 -- "fgOpenWindow should only return after the window opens". This is a *nix change and I am building on Windows, so somebody else needs to test this change. Modified Paths: -------------- trunk/freeglut/freeglut/src/freeglut_window.c Modified: trunk/freeglut/freeglut/src/freeglut_window.c =================================================================== --- trunk/freeglut/freeglut/src/freeglut_window.c 2011-01-25 05:47:56 UTC (rev 890) +++ trunk/freeglut/freeglut/src/freeglut_window.c 2011-01-25 05:56:38 UTC (rev 891) @@ -31,6 +31,7 @@ #if TARGET_HOST_POSIX_X11 #include <limits.h> /* LONG_MAX */ +#include <unistd.h> /* usleep */ #endif #if defined(_WIN32_WCE) @@ -905,7 +906,15 @@ #endif +#if TARGET_HOST_POSIX_X11 +static Bool fghWindowIsVisible( Display *display, XEvent *event, XPointer arg) +{ + Window window = arg; + return (event->type == MapNotify) && (event->xmap.window == window); +} +#endif + /* * Opens a window. Requires a SFG_Window object created and attached * to the freeglut structure. OpenGL context is created here. @@ -921,6 +930,7 @@ XTextProperty textProperty; XSizeHints sizeHints; XWMHints wmHints; + XEvent eventReturnBuffer; /* return buffer required for a call */ unsigned long mask; int num_FBConfigs, i; unsigned int current_DisplayMode = fgState.DisplayMode ; @@ -1114,6 +1124,9 @@ XFree(visualInfo); + if( !isSubWindow) + XPeekIfEvent( fgDisplay.Display, &eventReturnBuffer, &fghWindowIsVisible, window->Window.Handle ); + #elif TARGET_HOST_MS_WINDOWS WNDCLASS wc; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |