X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fdnalogo.c;h=4e1bafcd854ce62c1cb70f5728aea064d2f1feb4;hp=075fb55877e9ad3c5e7c2e6fc2a23f4f1a765aee;hb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e;hpb=dba664f31aa87285db4d76cf8c5e66335299703a diff --git a/hacks/glx/dnalogo.c b/hacks/glx/dnalogo.c index 075fb558..4e1bafcd 100644 --- a/hacks/glx/dnalogo.c +++ b/hacks/glx/dnalogo.c @@ -1,4 +1,4 @@ -/* DNA Logo, Copyright (c) 2001-2011 Jamie Zawinski +/* DNA Logo, Copyright (c) 2001-2014 Jamie Zawinski * * DNA Lounge * @@ -1985,7 +1985,7 @@ init_logo (ModeInfo *mi) dc->color[3] = 1.0; } - dc->trackball = gltrackball_init (); + dc->trackball = gltrackball_init (False); dc->gasket_spinnerx.probability = 0.1; dc->gasket_spinnery.probability = 0.1; @@ -2122,39 +2122,10 @@ logo_handle_event (ModeInfo *mi, XEvent *event) { logo_configuration *dc = &dcs[MI_SCREEN(mi)]; - if (event->xany.type == ButtonPress && - event->xbutton.button == Button1) - { - dc->button_down_p = True; - gltrackball_start (dc->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) - { - dc->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 (dc->trackball, event->xbutton.button, 10, - !!event->xbutton.state); - return True; - } - else if (event->xany.type == MotionNotify && - dc->button_down_p) - { - gltrackball_track (dc->trackball, - event->xmotion.x, event->xmotion.y, - MI_WIDTH (mi), MI_HEIGHT (mi)); - return True; - } + if (gltrackball_event_handler (event, dc->trackball, + MI_WIDTH (mi), MI_HEIGHT (mi), + &dc->button_down_p)) + return True; return False; }