X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_gamemode.c;h=313f546fd205fd7590e7620b42fbb5ce54c95250;hb=ed6b95e994d10023d3d6a230667f019373fe50b5;hp=b30b46f54be6e321e0af94b4d3a24c762bd82b91;hpb=f075b2126dff4d88bc2811281f0d27e7c0581ab4;p=freeglut diff --git a/src/freeglut_gamemode.c b/src/freeglut_gamemode.c index b30b46f..313f546 100644 --- a/src/freeglut_gamemode.c +++ b/src/freeglut_gamemode.c @@ -291,10 +291,13 @@ static GLboolean fghChangeDisplayMode( GLboolean haveToTest ) } # else + /* * XXX warning fghChangeDisplayMode: missing XFree86 video mode extensions, * XXX game mode will not change screen resolution when activated */ + success = GL_TRUE; + # endif #elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE @@ -435,24 +438,12 @@ int FGAPIENTRY glutEnterGameMode( void ) #if TARGET_HOST_UNIX_X11 - /* Move the window up to the topleft corner */ - XMoveWindow( fgDisplay.Display, fgStructure.Window->Window.Handle, 0, 0 ); - /* * Sync needed to avoid a real race, the Xserver must have really created * the window before we can grab the pointer into it: */ XSync( fgDisplay.Display, False ); - /* Move the Pointer to the middle of the fullscreen window */ - XWarpPointer( - fgDisplay.Display, - None, - fgDisplay.RootWindow, - 0, 0, 0, 0, - fgState.GameModeSize.X/2, fgState.GameModeSize.Y/2 - ); - /* * Grab the pointer to confine it into the window after the calls to * XWrapPointer() which ensure that the pointer really enters the window. @@ -482,6 +473,15 @@ int FGAPIENTRY glutEnterGameMode( void ) CurrentTime ); + /* Move the Pointer to the middle of the fullscreen window */ + XWarpPointer( + fgDisplay.Display, + None, + fgDisplay.RootWindow, + 0, 0, 0, 0, + fgState.GameModeSize.X/2, fgState.GameModeSize.Y/2 + ); + # ifdef X_XF86VidModeSetViewPort if( fgDisplay.DisplayModeValid ) @@ -502,14 +502,14 @@ int FGAPIENTRY glutEnterGameMode( void ) /* Get the current postion of the drawable area on screen */ XTranslateCoordinates( fgDisplay.Display, - fgStructure.Window->Window.Handle, + fgStructure.CurrentWindow->Window.Handle, fgDisplay.RootWindow, 0, 0, &x, &y, &child ); /* Move the decorataions out of the topleft corner of the display */ - XMoveWindow( fgDisplay.Display, fgStructure.Window->Window.Handle, + XMoveWindow( fgDisplay.Display, fgStructure.CurrentWindow->Window.Handle, -x, -y); }