X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fdangerball.c;h=31a67419865b107730efc7ba30850bf23b5232ce;hb=2d04c4f22466851aedb6ed0f2919d148f726b889;hp=64de8a87bcc7414ab53cad8aa829391eeb46a36f;hpb=96bdd7cf6ea60c418a76921acaf0e34d6f5be930;p=xscreensaver diff --git a/hacks/glx/dangerball.c b/hacks/glx/dangerball.c index 64de8a87..31a67419 100644 --- a/hacks/glx/dangerball.c +++ b/hacks/glx/dangerball.c @@ -1,4 +1,4 @@ -/* dangerball, Copyright (c) 2001, 2002, 2003 Jamie Zawinski +/* dangerball, Copyright (c) 2001-2004 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 @@ -89,9 +89,9 @@ static XrmOptionDescRec opts[] = { }; static argtype vars[] = { - {(caddr_t *) &do_spin, "spin", "Spin", DEF_SPIN, t_Bool}, - {(caddr_t *) &do_wander, "wander", "Wander", DEF_WANDER, t_Bool}, - {(caddr_t *) &speed, "speed", "Speed", DEF_SPEED, t_Float}, + {&do_spin, "spin", "Spin", DEF_SPIN, t_Bool}, + {&do_wander, "wander", "Wander", DEF_WANDER, t_Bool}, + {&speed, "speed", "Speed", DEF_SPEED, t_Float}, }; ModeSpecOpt sws_opts = {countof(opts), opts, countof(vars), vars, NULL}; @@ -196,7 +196,7 @@ ball_handle_event (ModeInfo *mi, XEvent *event) ball_configuration *bp = &bps[MI_SCREEN(mi)]; if (event->xany.type == ButtonPress && - event->xbutton.button & Button1) + event->xbutton.button == Button1) { bp->button_down_p = True; gltrackball_start (bp->trackball, @@ -205,11 +205,19 @@ ball_handle_event (ModeInfo *mi, XEvent *event) return True; } else if (event->xany.type == ButtonRelease && - event->xbutton.button & Button1) + 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)) + { + gltrackball_mousewheel (bp->trackball, event->xbutton.button, 10, + !!event->xbutton.state); + return True; + } else if (event->xany.type == MotionNotify && bp->button_down_p) { @@ -266,7 +274,7 @@ init_ball (ModeInfo *mi) { double spin_speed = 10.0; - double wander_speed = 0.15; + double wander_speed = 0.12; double spin_accel = 2.0; bp->rot = make_rotator (do_spin ? spin_speed : 0,