X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fsurfaces.c;h=ddca134794a17cb9e54220daf22188350671795b;hb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e;hp=459d12245a257e7b1af45c28288872b5ae46aced;hpb=f0261d8acab611f3433160e4f07367b870439739;p=xscreensaver diff --git a/hacks/glx/surfaces.c b/hacks/glx/surfaces.c index 459d1224..ddca1347 100644 --- a/hacks/glx/surfaces.c +++ b/hacks/glx/surfaces.c @@ -436,34 +436,10 @@ ENTRYPOINT Bool surface_handle_event(ModeInfo *mi, XEvent *event) { surfacestruct *sp = &surface[MI_SCREEN(mi)]; - if (event->xany.type == ButtonPress && event->xbutton.button == Button1) - { - sp->button_down_p = True; - gltrackball_start(sp->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) - { - sp->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(sp->trackball, event->xbutton.button, 10, - !!event->xbutton.state); + if (gltrackball_event_handler (event, sp->trackball, + MI_WIDTH (mi), MI_HEIGHT (mi), + &sp->button_down_p)) return True; - } - else if (event->xany.type == MotionNotify && sp->button_down_p) - { - gltrackball_track (sp->trackball, event->xmotion.x, event->xmotion.y, - MI_WIDTH (mi), MI_HEIGHT (mi)); - return True; - } return False; } @@ -493,7 +469,7 @@ ENTRYPOINT void init_surface(ModeInfo *mi) 1.0, do_wander ? wander_speed : 0, True); - sp->trackball = gltrackball_init (); + sp->trackball = gltrackball_init (True); } if (!strcasecmp(surface_type,"random"))