X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_window.c;h=21b3006336e0de96447df0cdd9a22945f8d1b233;hb=1a7b5b7702bcc093a613b02be7af4720f2618c79;hp=3d8626997c777093924de78d54d2ce7d727c1f80;hpb=745bf511cbf62305fb50be7ee878bcb089880e43;p=freeglut diff --git a/src/freeglut_window.c b/src/freeglut_window.c index 3d86269..21b3006 100644 --- a/src/freeglut_window.c +++ b/src/freeglut_window.c @@ -64,8 +64,6 @@ */ #if TARGET_HOST_UNIX_X11 -#include "mwmborder.c" /* Brian Paul's decoration-zapping code. */ - XVisualInfo* fgChooseVisual( void ) { int bufferSize[] = { 16, 12, 8, 4, 2, 1 }; @@ -435,6 +433,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( @@ -558,46 +565,6 @@ void fgOpenWindow( SFG_Window* window, const char* title, int x, int y, int w, i */ XMapWindow( fgDisplay.Display, window->Window.Handle ); - /* - * If we're a menu, then we need to ask the WM to remove decorations. - * This is stolen shamelessly from Brian Paul - * (19 Sep 1995 brianp@ssec.wisc.edu) - */ - if ( window->IsMenu ) { - set_mwm_border(fgDisplay.Display, window->Window.Handle, 0); - } - - /* - * 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;