X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fbouncingcow.c;h=71bb56cbf6fcd190e449a3500661a2918652a1ba;hb=2d04c4f22466851aedb6ed0f2919d148f726b889;hp=3f85b598bba753686ba761146d19b1e5476f28f0;hpb=9c9d475ff889ed8be02e8ce8c17da28b93278fca;p=xscreensaver diff --git a/hacks/glx/bouncingcow.c b/hacks/glx/bouncingcow.c index 3f85b598..71bb56cb 100644 --- a/hacks/glx/bouncingcow.c +++ b/hacks/glx/bouncingcow.c @@ -23,7 +23,7 @@ extern XtAppContext app; #define EVENT_MASK PointerMotionMask #define sws_opts xlockmore_opts -#define DEF_SPEED "1.0" +#define DEF_SPEED "0.7" #define DEF_TEXTURE "(none)" #define DEFAULTS "*delay: 30000 \n" \ @@ -100,7 +100,7 @@ static const char *do_texture; static XrmOptionDescRec opts[] = { { "-speed", ".speed", XrmoptionSepArg, 0 }, {"-texture", ".texture", XrmoptionSepArg, 0 }, - {"+texture", ".texture", XrmoptionNoArg, (caddr_t) "(none)" }, + {"+texture", ".texture", XrmoptionNoArg, "(none)" }, }; static argtype vars[] = { @@ -196,7 +196,7 @@ cow_handle_event (ModeInfo *mi, XEvent *event) cow_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 @@ cow_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) {