X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fklein.c;h=07e6f7ced7439b86081f2a4a63b64bbf53474813;hb=2d04c4f22466851aedb6ed0f2919d148f726b889;hp=8d508330ae0674879f7a5bc05cc330e81834ba77;hpb=e4fa2ac140f7bc56571373a7b7eb585fa4500e38;p=xscreensaver diff --git a/hacks/glx/klein.c b/hacks/glx/klein.c index 8d508330..07e6f7ce 100644 --- a/hacks/glx/klein.c +++ b/hacks/glx/klein.c @@ -10,13 +10,6 @@ * */ -/*- - * due to a Bug/feature in VMS X11/Intrinsic.h has to be placed before xlock. - * otherwise caddr_t is not defined correctly - */ - -#include - #ifdef STANDALONE # define PROGCLASS "Klein" # define HACK_INIT init_klein @@ -89,7 +82,7 @@ static Bool do_spin; static Bool do_wander; static XrmOptionDescRec opts[] = { - {"-speed", ".speed", XrmoptionSepArg, (caddr_t) 0 }, + {"-speed", ".speed", XrmoptionSepArg, 0 }, { "-spin", ".spin", XrmoptionNoArg, "True" }, { "+spin", ".spin", XrmoptionNoArg, "False" }, { "-wander", ".wander", XrmoptionNoArg, "True" }, @@ -307,14 +300,20 @@ klein_handle_event (ModeInfo *mi, XEvent *event) { kleinstruct *kp = &klein[MI_SCREEN(mi)]; - if (event->xany.type == ButtonPress && event->xbutton.button & Button1) { + if (event->xany.type == ButtonPress && event->xbutton.button == Button1) { kp->button_down_p = True; gltrackball_start (kp->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) { + } else if (event->xany.type == ButtonRelease && event->xbutton.button == Button1) { kp->button_down_p = False; return True; - } else if (event->xany.type == MotionNotify && kp->button_down_p) { + } else if (event->xany.type == ButtonPress && + (event->xbutton.button == Button4 || + event->xbutton.button == Button5)) { + gltrackball_mousewheel (kp->trackball, event->xbutton.button, 10, + !!event->xbutton.state); + return True; + } else if (event->xany.type == MotionNotify && kp->button_down_p) { gltrackball_track (kp->trackball, event->xmotion.x, event->xmotion.y, MI_WIDTH (mi), MI_HEIGHT (mi)); return True; }