X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fboing.c;h=91fd6383fbcdf0694a2c5f362e3f5c1d6c43ceeb;hp=3396217ffeabe84c5fe0b091722734d93d154c7b;hb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e;hpb=dba664f31aa87285db4d76cf8c5e66335299703a diff --git a/hacks/glx/boing.c b/hacks/glx/boing.c index 3396217f..91fd6383 100644 --- a/hacks/glx/boing.c +++ b/hacks/glx/boing.c @@ -1,4 +1,4 @@ -/* boing, Copyright (c) 2005-2012 Jamie Zawinski +/* boing, Copyright (c) 2005-2014 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -485,39 +485,10 @@ boing_handle_event (ModeInfo *mi, XEvent *event) { boing_configuration *bp = &bps[MI_SCREEN(mi)]; - if (event->xany.type == ButtonPress && - event->xbutton.button == Button1) - { - bp->button_down_p = True; - gltrackball_start (bp->trackball, - event->xbutton.x, event->xbutton.y, - MI_WIDTH (mi), MI_HEIGHT (mi)); - return True; - } - else if (event->xany.type == ButtonRelease && - event->xbutton.button == Button1) - { - bp->button_down_p = False; - return True; - } - else if (event->xany.type == ButtonPress && - (event->xbutton.button == Button4 || - event->xbutton.button == Button5 || - event->xbutton.button == Button6 || - event->xbutton.button == Button7)) - { - gltrackball_mousewheel (bp->trackball, event->xbutton.button, 10, - !!event->xbutton.state); - return True; - } - else if (event->xany.type == MotionNotify && - bp->button_down_p) - { - gltrackball_track (bp->trackball, - event->xmotion.x, event->xmotion.y, - MI_WIDTH (mi), MI_HEIGHT (mi)); - return True; - } + if (gltrackball_event_handler (event, bp->trackball, + MI_WIDTH (mi), MI_HEIGHT (mi), + &bp->button_down_p)) + return True; return False; } @@ -608,7 +579,7 @@ init_boing (ModeInfo *mi) bp->ball_dz = speed * 6 + frand(speed); - bp->trackball = gltrackball_init (); + bp->trackball = gltrackball_init (False); }