X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fsurfaces.c;h=ddca134794a17cb9e54220daf22188350671795b;hp=9dac523bfb649778a38ad5aae086feccefa4fc75;hb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e;hpb=dba664f31aa87285db4d76cf8c5e66335299703a diff --git a/hacks/glx/surfaces.c b/hacks/glx/surfaces.c index 9dac523b..ddca1347 100644 --- a/hacks/glx/surfaces.c +++ b/hacks/glx/surfaces.c @@ -163,10 +163,7 @@ static void draw(ModeInfo *mi) get_position(sp->rot, &x, &y, &z, !sp->button_down_p); glTranslatef((x-0.5)*10, (y-0.5)*10, (z-0.5)*20); - /* Do it twice because we don't track the device's orientation. */ - glRotatef( current_device_rotation(), 0, 0, 1); gltrackball_rotate(sp->trackball); - glRotatef(-current_device_rotation(), 0, 0, 1); get_rotation(sp->rot, &x, &y, &z, !sp->button_down_p); glRotatef(x*360, 1.0, 0.0, 0.0); @@ -439,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; } @@ -496,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"))