X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=sidebyside;f=src%2Fx11%2Ffg_main_x11.c;h=0bf967dd1c1d5a4534a6246a710c16a42ed1b6f1;hb=bac05204a224d9cabe6b7d52c00d2e0601825cb4;hp=8a8514e2f1d8918220319b9699adeb354780b2cc;hpb=0e653a9d94fec583f7a4172b721c1c599e06cbc8;p=freeglut diff --git a/src/x11/fg_main_x11.c b/src/x11/fg_main_x11.c index 8a8514e..0bf967d 100644 --- a/src/x11/fg_main_x11.c +++ b/src/x11/fg_main_x11.c @@ -40,7 +40,6 @@ # define VFPRINTF(s,f,a) #endif -#include "fg_main.h" /* * Try to get the maximum value allowed for ints, falling back to the minimum @@ -72,27 +71,6 @@ static Bool match_motion(Display *dpy, XEvent *xev, XPointer arg); */ -/* - * Handle a window configuration change. When no reshape - * callback is hooked, the viewport size is updated to - * match the new window size. - */ -void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height ) -{ - XResizeWindow( fgDisplay.pDisplay.Display, window->Window.Handle, - width, height ); - XFlush( fgDisplay.pDisplay.Display ); /* XXX Shouldn't need this */ -} - - -/* - * A static helper function to execute display callback for a window - */ -void fgPlatformDisplayWindow ( SFG_Window *window ) -{ - fghRedrawWindow ( window ) ; -} - fg_time_t fgPlatformSystemTime ( void ) { @@ -630,10 +608,11 @@ void fgPlatformProcessSingleEvent ( void ) switch( event.type ) { case ClientMessage: - if(fgIsSpaceballXEvent(&event)) { - fgSpaceballHandleXEvent(&event); - break; - } + if (fgStructure.CurrentWindow) + if(fgIsSpaceballXEvent(&event)) { + fgSpaceballHandleXEvent(&event); + break; + } /* Destroy the window when the WM_DELETE_WINDOW message arrives */ if( (Atom) event.xclient.data.l[ 0 ] == fgDisplay.pDisplay.DeleteWindow ) { @@ -683,13 +662,7 @@ void fgPlatformProcessSingleEvent ( void ) window->State.pWState.OldWidth = width; window->State.pWState.OldHeight = height; - if( FETCH_WCB( *window, Reshape ) ) - INVOKE_WCB( *window, Reshape, ( width, height ) ); - else - { - fgSetWindow( window ); - glViewport( 0, 0, width, height ); - } + INVOKE_WCB( *window, Reshape, ( width, height ) ); glutPostRedisplay( ); if( window->IsMenu ) fgSetWindow( current_window );