X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fendgame.c;h=4393a6783f6a659e12fd6ff6dd4422acc1b3f428;hb=2d04c4f22466851aedb6ed0f2919d148f726b889;hp=41131c28d325c032fa3879becbd0c04127e5fc8b;hpb=9c9d475ff889ed8be02e8ce8c17da28b93278fca;p=xscreensaver diff --git a/hacks/glx/endgame.c b/hacks/glx/endgame.c index 41131c28..4393a678 100644 --- a/hacks/glx/endgame.c +++ b/hacks/glx/endgame.c @@ -48,14 +48,14 @@ #define countof(x) (sizeof((x))/sizeof((*x))) static XrmOptionDescRec opts[] = { - {"+rotate", ".chess.rotate", XrmoptionNoArg, (caddr_t) "false" }, - {"-rotate", ".chess.rotate", XrmoptionNoArg, (caddr_t) "true" }, - {"+reflections", ".chess.reflections", XrmoptionNoArg, (caddr_t) "false" }, - {"-reflections", ".chess.reflections", XrmoptionNoArg, (caddr_t) "true" }, - {"+shadows", ".chess.shadows", XrmoptionNoArg, (caddr_t) "false" }, - {"-shadows", ".chess.shadows", XrmoptionNoArg, (caddr_t) "true" }, - {"+smooth", ".chess.smooth", XrmoptionNoArg, (caddr_t) "false" }, - {"-smooth", ".chess.smooth", XrmoptionNoArg, (caddr_t) "true" }, + {"+rotate", ".chess.rotate", XrmoptionNoArg, "false" }, + {"-rotate", ".chess.rotate", XrmoptionNoArg, "true" }, + {"+reflections", ".chess.reflections", XrmoptionNoArg, "false" }, + {"-reflections", ".chess.reflections", XrmoptionNoArg, "true" }, + {"+shadows", ".chess.shadows", XrmoptionNoArg, "false" }, + {"-shadows", ".chess.shadows", XrmoptionNoArg, "true" }, + {"+smooth", ".chess.smooth", XrmoptionNoArg, "false" }, + {"-smooth", ".chess.smooth", XrmoptionNoArg, "true" }, }; int rotate, reflections, smooth, shadows; @@ -206,7 +206,7 @@ double theta = 0.0; Bool chess_handle_event (ModeInfo *mi, XEvent *event) { Chesscreen *c = &qs[MI_SCREEN(mi)]; - if(event->xany.type == ButtonPress && event->xbutton.button & Button1) { + if(event->xany.type == ButtonPress && event->xbutton.button == Button1) { c->button_down_p = True; gltrackball_start (c->trackball, event->xbutton.x, event->xbutton.y, @@ -214,10 +214,18 @@ Bool chess_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) { gltrackball_track (c->trackball, event->xmotion.x, event->xmotion.y,