X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_window.c;h=eda79f200a9a88cf8e4371560602a1d368d36875;hb=075a7a7ef67011d9f2c2ae939bc287fa97fc1b8f;hp=08cb8d97645c8e19da57a19b6a17b3184ed5dd23;hpb=fe89df7de1aa6a732a441e983cce03e1fd6fd81a;p=freeglut diff --git a/src/freeglut_window.c b/src/freeglut_window.c index 08cb8d9..eda79f2 100644 --- a/src/freeglut_window.c +++ b/src/freeglut_window.c @@ -63,6 +63,7 @@ * Chooses a visual basing on the current display mode settings */ #if TARGET_HOST_UNIX_X11 + XVisualInfo* fgChooseVisual( void ) { int bufferSize[] = { 16, 12, 8, 4, 2, 1 }; @@ -305,6 +306,8 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly, unsigned void fgSetWindow ( SFG_Window *window ) { #if TARGET_HOST_UNIX_X11 + if ( window ) + { /* * Make the selected window's GLX context the current one */ @@ -313,7 +316,7 @@ void fgSetWindow ( SFG_Window *window ) window->Window.Handle, window->Window.Context ); - + } #elif TARGET_HOST_WIN32 /* * Release the previous' context's device context @@ -432,6 +435,15 @@ void fgOpenWindow( SFG_Window* window, const char* title, int x, int y, int w, i mask = CWBackPixmap | CWBorderPixel | CWColormap | CWEventMask; /* + * If this is a menu window we want the window manager to ignore it. + */ + if ( fgState.BuildingAMenu ) + { + winAttr.override_redirect = True; + mask |= CWOverrideRedirect; + } + + /* * Have the window created now */ window->Window.Handle = XCreateWindow( @@ -555,37 +567,6 @@ void fgOpenWindow( SFG_Window* window, const char* title, int x, int y, int w, i */ XMapWindow( fgDisplay.Display, window->Window.Handle ); - /* - * In game mode, move the viewport a bit to hide the decorations. - * This code depends on the XFree86 video mode extensions. - */ - if( gameMode == TRUE ) - { - /* - * This somehow fixes the glutGet() GLUT_WINDOW_X and GLUT_WINDOW_Y problem... - */ - XMoveWindow( fgDisplay.Display, window->Window.Handle, x, y ); - -# ifdef X_XF86VidModeSetViewPort - - /* - * Set the newly created window as the current one... - */ - fgSetWindow( window ); - - /* - * Move the viewport a bit down and right from top-left corner to hide the decorations - */ - XF86VidModeSetViewPort( - fgDisplay.Display, - fgDisplay.Screen, - glutGet( GLUT_WINDOW_X ), - glutGet( GLUT_WINDOW_Y ) - ); - -# endif - } - #elif TARGET_HOST_WIN32 WNDCLASS wc;