(110) Fixed compiliation of freeglut_joystick.c on FreeBSD
+*******************************************************************************************
+* Freeglut 2.0.0 Released on September 29, 2003!
+*******************************************************************************************
+
+*******************************************************************************************
+* Changes on October 3, 2003
+*******************************************************************************************
-
+(110) Tweaking for the menu behavior on Linux regarding mice, etc. - John Fay
*/
if( window->ActiveMenu != NULL )
{
+ if ( window == window->ActiveMenu->ParentWindow )
+ {
+ window->ActiveMenu->Window->State.MouseX = event.xmotion.x_root - window->ActiveMenu->X ;
+ window->ActiveMenu->Window->State.MouseY = event.xmotion.y_root - window->ActiveMenu->Y ;
+ }
+
/*
* Let's make the window redraw as a result of the mouse motion.
*/
- window->State.Redisplay = TRUE ;
+ window->ActiveMenu->Window->State.Redisplay = TRUE ;
/*
* Since the window is a menu, make the parent window current
*/
fgSetWindow ( window->ActiveMenu->ParentWindow ) ;
- break;
+ break; /* I think this should stay in -- an active menu should absorb the mouse motion */
}
/*
*/
if ( window->ActiveMenu != NULL ) /* Window has an active menu, it absorbs any mouse click */
{
- if ( fgCheckActiveMenu ( window, window->ActiveMenu ) == TRUE ) /* Inside the menu, invoke the callback and deactivate the menu*/
+ if ( window == window->ActiveMenu->ParentWindow )
+ {
+ window->ActiveMenu->Window->State.MouseX = event.xbutton.x_root - window->ActiveMenu->X ;
+ window->ActiveMenu->Window->State.MouseY = event.xbutton.y_root - window->ActiveMenu->Y ;
+ }
+
+ if ( fgCheckActiveMenu ( window->ActiveMenu->Window, window->ActiveMenu ) == TRUE ) /* Inside the menu, invoke the callback and deactivate the menu*/
{
/* Save the current window and menu and set the current window to the window whose menu this is */
SFG_Window *save_window = fgStructure.Window ;
void fgDestroyWindow( SFG_Window* window, GLboolean needToClose )
{
SFG_Window* subWindow;
+ int menu_index ;
assert( window != NULL );
freeglut_assert_ready;
else
fgListRemove( &fgStructure.Windows, &window->Node );
+ if ( window->ActiveMenu != NULL )
+ fgDeactivateMenu ( window ) ;
+
+ for ( menu_index = 0; menu_index < 3; menu_index ++ )
+ {
+ if ( window->Menu[menu_index] != NULL )
+ window->Menu[menu_index]->ParentWindow = NULL ;
+ }
+
/*
* OK, this window seems disconnected from the structure enough
* in order to be closed without any bigger risks...