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.

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@891 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
fayjf 2011-01-25 05:56:38 +00:00
parent 4a9a84130a
commit f86a562414

View File

@ -31,6 +31,7 @@
#if TARGET_HOST_POSIX_X11 #if TARGET_HOST_POSIX_X11
#include <limits.h> /* LONG_MAX */ #include <limits.h> /* LONG_MAX */
#include <unistd.h> /* usleep */
#endif #endif
#if defined(_WIN32_WCE) #if defined(_WIN32_WCE)
@ -905,6 +906,14 @@ static void get_display_origin(int *xp,int *yp)
#endif #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 * Opens a window. Requires a SFG_Window object created and attached
@ -921,6 +930,7 @@ void fgOpenWindow( SFG_Window* window, const char* title,
XTextProperty textProperty; XTextProperty textProperty;
XSizeHints sizeHints; XSizeHints sizeHints;
XWMHints wmHints; XWMHints wmHints;
XEvent eventReturnBuffer; /* return buffer required for a call */
unsigned long mask; unsigned long mask;
int num_FBConfigs, i; int num_FBConfigs, i;
unsigned int current_DisplayMode = fgState.DisplayMode ; unsigned int current_DisplayMode = fgState.DisplayMode ;
@ -1114,6 +1124,9 @@ void fgOpenWindow( SFG_Window* window, const char* title,
XFree(visualInfo); XFree(visualInfo);
if( !isSubWindow)
XPeekIfEvent( fgDisplay.Display, &eventReturnBuffer, &fghWindowIsVisible, window->Window.Handle );
#elif TARGET_HOST_MS_WINDOWS #elif TARGET_HOST_MS_WINDOWS
WNDCLASS wc; WNDCLASS wc;