X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fstonerview.c;h=e504709d7b7e0dcff8dd9583b86a4b8f1f10e4b7;hp=0e11395e2ace623c7c2b8c2603daddba80e4e598;hb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e;hpb=dba664f31aa87285db4d76cf8c5e66335299703a diff --git a/hacks/glx/stonerview.c b/hacks/glx/stonerview.c index 0e11395e..e504709d 100644 --- a/hacks/glx/stonerview.c +++ b/hacks/glx/stonerview.c @@ -94,7 +94,7 @@ init_stonerview (ModeInfo *mi) bp->glx_context = init_GL(mi); - bp->trackball = gltrackball_init (); + bp->trackball = gltrackball_init (False); bp->st = stonerview_init_view(MI_IS_WIREFRAME(mi), transparent_p); stonerview_init_move(bp->st); @@ -147,39 +147,10 @@ stonerview_handle_event (ModeInfo *mi, XEvent *event) { stonerview_configuration *bp = &bps[MI_SCREEN(mi)]; - if (event->xany.type == ButtonPress && - event->xbutton.button == Button1) - { - bp->button_down_p = True; - gltrackball_start (bp->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) - { - bp->button_down_p = False; - return True; - } - else if (event->xany.type == ButtonPress && - (event->xbutton.button == Button4 || - event->xbutton.button == Button5 || - event->xbutton.button == Button6 || - event->xbutton.button == Button7)) - { - gltrackball_mousewheel (bp->trackball, event->xbutton.button, 10, - !!event->xbutton.state); - return True; - } - else if (event->xany.type == MotionNotify && - bp->button_down_p) - { - gltrackball_track (bp->trackball, - event->xmotion.x, event->xmotion.y, - MI_WIDTH (mi), MI_HEIGHT (mi)); - return True; - } + if (gltrackball_event_handler (event, bp->trackball, + MI_WIDTH (mi), MI_HEIGHT (mi), + &bp->button_down_p)) + return True; return False; }