*/
#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 };
void fgSetWindow ( SFG_Window *window )
{
#if TARGET_HOST_UNIX_X11
+ if ( window )
+ {
/*
* Make the selected window's GLX context the current one
*/
window->Window.Handle,
window->Window.Context
);
-
+ }
#elif TARGET_HOST_WIN32
/*
* Release the previous' context's device context
*/
fgState.DisplayMode |= GLUT_DOUBLE ;
window->Window.VisualInfo = fgChooseVisual();
+ /* OK, we got a double-buffered window, but we only wanted
+ * single-buffered. Clear the double-buffer flag now.
+ */
+ fgState.DisplayMode &= ~GLUT_DOUBLE ;
}
/*
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(
*/
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;
{
freeglut_assert_ready; freeglut_assert_window;
- /*
- * Just have the window repositioned and resized
- */
- glutPositionWindow( 0, 0 );
+#if TARGET_HOST_UNIX_X11
+ {
+ int x, y;
+ Window w;
+
+ XMoveResizeWindow(
+ fgDisplay.Display,
+ fgStructure.Window->Window.Handle,
+ 0, 0,
+ fgDisplay.ScreenWidth,
+ fgDisplay.ScreenHeight
+ );
+ XFlush( fgDisplay.Display );
+
+ XTranslateCoordinates(
+ fgDisplay.Display,
+ fgStructure.Window->Window.Handle,
+ fgDisplay.RootWindow,
+ 0, 0, &x, &y, &w
+ );
- glutReshapeWindow(
+ if (x || y)
+ {
+ XMoveWindow(
+ fgDisplay.Display,
+ fgStructure.Window->Window.Handle,
+ -x, -y
+ );
+ XFlush( fgDisplay.Display );
+ }
+ }
+#elif TARGET_HOST_WIN32
+ MoveWindow(
+ fgStructure.Window->Window.Handle,
+ 0, 0,
fgDisplay.ScreenWidth,
- fgDisplay.ScreenHeight
+ fgDisplay.ScreenHeight,
+ TRUE
);
+#endif
}
/*
}
/*** END OF FILE ***/
-
-
-
-
-
-
-
-
-