X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fmenger.c;h=0f492641f0b3f42a4b53392a1fa2410f480d8a6d;hb=2d04c4f22466851aedb6ed0f2919d148f726b889;hp=7686941b3eceb8a6f09b32590bfdd84cd2afc37c;hpb=c28aecf9fc41e3a03494bacf7279745425e2fa18;p=xscreensaver diff --git a/hacks/glx/menger.c b/hacks/glx/menger.c index 7686941b..0f492641 100644 --- a/hacks/glx/menger.c +++ b/hacks/glx/menger.c @@ -1,4 +1,4 @@ -/* menger, Copyright (c) 2001, 2002 Jamie Zawinski +/* menger, Copyright (c) 2001, 2002, 2004 Jamie Zawinski * Copyright (c) 2002 Aurelien Jacobs * * Permission to use, copy, modify, distribute, and sell this software and its @@ -129,15 +129,15 @@ static XrmOptionDescRec opts[] = { { "-speed", ".speed", XrmoptionSepArg, 0 }, { "-optimize", ".optimize", XrmoptionNoArg, "True" }, { "+optimize", ".optimize", XrmoptionNoArg, "False" }, - {"-depth", ".maxDepth", XrmoptionSepArg, (caddr_t) 0 }, + {"-depth", ".maxDepth", XrmoptionSepArg, 0 }, }; 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_Int}, - {(caddr_t *) &do_optimize, "optimize", "Optimize", DEF_OPTIMIZE, t_Bool}, - {(caddr_t *) &max_depth, "maxDepth", "MaxDepth", DEF_MAX_DEPTH, t_Int}, + {&do_spin, "spin", "Spin", DEF_SPIN, t_Bool}, + {&do_wander, "wander", "Wander", DEF_WANDER, t_Bool}, + {&speed, "speed", "Speed", DEF_SPEED, t_Int}, + {&do_optimize, "optimize", "Optimize", DEF_OPTIMIZE, t_Bool}, + {&max_depth, "maxDepth", "MaxDepth", DEF_MAX_DEPTH, t_Int}, }; ModeSpecOpt sws_opts = {countof(opts), opts, countof(vars), vars, NULL}; @@ -359,7 +359,7 @@ sponge_handle_event (ModeInfo *mi, XEvent *event) sponge_configuration *sp = &sps[MI_SCREEN(mi)]; if (event->xany.type == ButtonPress && - event->xbutton.button & Button1) + event->xbutton.button == Button1) { sp->button_down_p = True; gltrackball_start (sp->trackball, @@ -368,11 +368,19 @@ sponge_handle_event (ModeInfo *mi, XEvent *event) return True; } else if (event->xany.type == ButtonRelease && - event->xbutton.button & Button1) + event->xbutton.button == Button1) { sp->button_down_p = False; return True; } + else if (event->xany.type == ButtonPress && + (event->xbutton.button == Button4 || + event->xbutton.button == Button5)) + { + gltrackball_mousewheel (sp->trackball, event->xbutton.button, 5, + !!event->xbutton.state); + return True; + } else if (event->xany.type == MotionNotify && sp->button_down_p) {