X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=sidebyside;f=src%2Ffreeglut_main.c;h=fb8f9bbdf26c6b8668866fff2ddc1ebd03b1b41c;hb=58d16ae0b8baad8cadb1b5d83a39bce0d34af417;hp=6c569d3d376e1fbe58e59b3ba08169a3a7fbdd0e;hpb=9e880aa45091c604cffa4e564e395e2385c01e25;p=freeglut diff --git a/src/freeglut_main.c b/src/freeglut_main.c index 6c569d3..fb8f9bb 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -619,20 +619,13 @@ void FGAPIENTRY glutMainLoopEvent( void ) break; case EnterNotify: - { - GETWINDOW( xcrossing ); - GETMOUSE( xcrossing ); - INVOKE_WCB( *window, Entry, ( GLUT_ENTERED ) ); - } - break; - /* XXX Combine EnterNotify and LeaveNotify */ case LeaveNotify: - { GETWINDOW( xcrossing ); GETMOUSE( xcrossing ); - INVOKE_WCB( *window, Entry, ( GLUT_LEFT ) ); - } - break; + INVOKE_WCB( *window, Entry, ( ( EnterNotify == event.type ) ? + GLUT_ENTERED : + GLUT_LEFT ) ); + break; case MotionNotify: { @@ -801,7 +794,7 @@ void FGAPIENTRY glutMainLoopEvent( void ) * * XXX Use a symbolic constant, *not* "4"! */ - if( ( button < 4 ) || ( ! FETCH_WCB( *window, MouseWheel ) ) ) + if( ( button < 3 ) || ( ! FETCH_WCB( *window, MouseWheel ) ) ) { INVOKE_WCB( *window, Mouse, ( button, pressed ? GLUT_DOWN : GLUT_UP, @@ -819,9 +812,14 @@ void FGAPIENTRY glutMainLoopEvent( void ) * XXX since the order and numbering isn't certain * XXX See XFree86 configuration docs (even back in the * XXX 3.x days, and especially with 4.x). + * + * XXX Note that {button} has already been decremeted + * XXX in mapping from X button numbering to GLUT. */ - int wheel_number = (button - 4) / 2; - int direction = (button & 1)*2 - 1; + int wheel_number = (button - 3) / 2; + int direction = -1; + if( button % 2 ) + direction = 1; if( pressed ) INVOKE_WCB( *window, MouseWheel, ( wheel_number, @@ -947,6 +945,9 @@ void FGAPIENTRY glutMainLoopEvent( void ) } break; + case ReparentNotify: + break; /* XXX Should disable this event */ + default: fgWarning ("Unknown X event type: %d", event.type); break;