X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fflipflop.c;h=af671ca802aa3f52899c153b2ea1f91de5accd95;hb=2d04c4f22466851aedb6ed0f2919d148f726b889;hp=6e1593d9b106b72e61848091620f6e3df3afd44e;hpb=6a1da724858673ac40aa13a9612340d8bed8c7b9;p=xscreensaver diff --git a/hacks/glx/flipflop.c b/hacks/glx/flipflop.c index 6e1593d9..af671ca8 100644 --- a/hacks/glx/flipflop.c +++ b/hacks/glx/flipflop.c @@ -48,8 +48,8 @@ #define countof(x) (sizeof((x))/sizeof((*x))) static XrmOptionDescRec opts[] = { - {"+rotate", ".flipflop.rotate", XrmoptionNoArg, (caddr_t) "false" }, - {"-rotate", ".flipflop.rotate", XrmoptionNoArg, (caddr_t) "true" }, + {"+rotate", ".flipflop.rotate", XrmoptionNoArg, "false" }, + {"-rotate", ".flipflop.rotate", XrmoptionNoArg, "true" }, }; @@ -57,7 +57,7 @@ static XrmOptionDescRec opts[] = { static int rotate, wire, clearbits; static argtype vars[] = { - {(caddr_t *) &rotate, "rotate", "Rotate", "True", t_Bool}, + { &rotate, "rotate", "Rotate", "True", t_Bool}, }; ModeSpecOpt flipflop_opts = {countof(opts), opts, countof(vars), vars, NULL}; @@ -146,7 +146,7 @@ flipflop_handle_event (ModeInfo *mi, XEvent *event) Flipflopcreen *c = &qs[MI_SCREEN(mi)]; if (event->xany.type == ButtonPress && - event->xbutton.button & Button1) + event->xbutton.button == Button1) { c->button_down_p = True; gltrackball_start (c->trackball, @@ -155,11 +155,19 @@ flipflop_handle_event (ModeInfo *mi, XEvent *event) return True; } else if (event->xany.type == ButtonRelease && - event->xbutton.button & Button1) + event->xbutton.button == Button1) { c->button_down_p = False; return True; } + else if (event->xany.type == ButtonPress && + (event->xbutton.button == Button4 || + event->xbutton.button == Button5)) + { + gltrackball_mousewheel (c->trackball, event->xbutton.button, 5, + !event->xbutton.state); + return True; + } else if (event->xany.type == MotionNotify && c->button_down_p) {