X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fsurfaces.c;h=9ea84cddfa07cd12ad4f10413e24efc448f1b6cc;hb=refs%2Fheads%2Fmaster2;hp=459d12245a257e7b1af45c28288872b5ae46aced;hpb=f0261d8acab611f3433160e4f07367b870439739;p=xscreensaver diff --git a/hacks/glx/surfaces.c b/hacks/glx/surfaces.c index 459d1224..9ea84cdd 100644 --- a/hacks/glx/surfaces.c +++ b/hacks/glx/surfaces.c @@ -43,7 +43,8 @@ #ifdef STANDALONE # define DEFAULTS "*delay: 20000 \n" \ - "*showFPS: False \n" + "*showFPS: False \n" \ + "*suppressRotationAnimation: True\n" \ # define refresh_surface 0 # include "xlockmore.h" /* from the xscreensaver distribution */ @@ -428,6 +429,14 @@ ENTRYPOINT void reshape_surface(ModeInfo *mi, int width, int height) glLoadIdentity(); gluLookAt(0.0, 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); +# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */ + { + int o = (int) current_device_rotation(); + if (o != 0 && o != 180 && o != -180) + glScalef (1/h, 1/h, 1/h); + } +# endif + glClear(GL_COLOR_BUFFER_BIT); } @@ -436,34 +445,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; + if (gltrackball_event_handler (event, sp->trackball, + MI_WIDTH (mi), MI_HEIGHT (mi), + &sp->button_down_p)) 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); - 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 +478,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"))