X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fmirrorblob.c;h=2fe9fc84ff15097b0f1b4156c963e13c9d583910;hb=refs%2Fheads%2Fmaster2;hp=6daa372f71fd0d46fadf6f94560f8b707d9bf8f1;hpb=b81f521c5ad7022ac12db18ca8fcdd9fb063831e;p=xscreensaver diff --git a/hacks/glx/mirrorblob.c b/hacks/glx/mirrorblob.c index 6daa372f..2fe9fc84 100644 --- a/hacks/glx/mirrorblob.c +++ b/hacks/glx/mirrorblob.c @@ -41,12 +41,10 @@ "*useSHM: True \n" \ "*desktopGrabber: xscreensaver-getimage -no-desktop %s\n" \ "*grabDesktopImages: True \n" \ - "*chooseRandomImages: True \n" + "*chooseRandomImages: True \n" \ + "*suppressRotationAnimation: True\n" \ # define refresh_mirrorblob 0 -/* -# define mirrorblob_handle_event 0 -*/ # include "xlockmore.h" #else /* !STANDALONE */ # include "xlock.h" /* from the xlockmore distribution */ @@ -1123,11 +1121,13 @@ initialise_blob(mirrorblobstruct *gp, * * Return the magnitude of the given vector */ +#if 0 static inline double length (Vector3D u) { return sqrt (u.x * u.x + u.y * u.y + u.z * u.z); } +#endif /****************************************************************************** * @@ -1416,7 +1416,7 @@ draw_blob (mirrorblobstruct *gp) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - glRotatef(current_device_rotation(), 0, 0, 1); +/* glRotatef(current_device_rotation(), 0, 0, 1); */ /* Move down the z-axis. */ glTranslatef (0.0, 0.0, -4.0); @@ -1473,13 +1473,15 @@ draw_background (ModeInfo *mi) glPushMatrix(); glLoadIdentity(); - glRotatef (rot, 0, 0, 1); + glRotatef (-rot, 0, 0, 1); +/* if ((rot > 45 && rot < 135) || (rot < -45 && rot > -135)) { GLfloat s = MI_WIDTH(mi) / (GLfloat) MI_HEIGHT(mi); glScalef (s, 1/s, 1); } +*/ glOrtho(0.0, MI_WIDTH(mi), MI_HEIGHT(mi), 0.0, -1000.0, 1000.0); @@ -1755,21 +1757,7 @@ mirrorblob_handle_event (ModeInfo * mi, XEvent * event) mirrorblobstruct *gp = &Mirrorblob[MI_SCREEN (mi)]; if (event->xany.type == ButtonPress && - event->xbutton.button == Button1) - { - gp->button_down = 1; - gltrackball_start (gp->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) - { - gp->button_down = 0; - return True; - } - else if (event->xany.type == ButtonPress && - event->xbutton.button == Button4) + event->xbutton.button == Button4) { zoom *= 1.1; return True; @@ -1781,12 +1769,19 @@ mirrorblob_handle_event (ModeInfo * mi, XEvent * event) zoom *= 0.9; return True; } - else if (event->xany.type == MotionNotify && gp->button_down) + else if (gltrackball_event_handler (event, gp->trackball, + MI_WIDTH (mi), MI_HEIGHT (mi), + &gp->button_down)) { - gltrackball_track (gp->trackball, event->xmotion.x, - event->xmotion.y, MI_WIDTH (mi), MI_HEIGHT (mi)); return True; } + else if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event)) + { + gp->state_start_time = 0; + gp->state = HOLDING; + return True; + } + return False; } @@ -1821,7 +1816,7 @@ init_mirrorblob(ModeInfo * mi) { MI_CLEARWINDOW(mi); } - gp->trackball = gltrackball_init(); + gp->trackball = gltrackball_init(False); initialise_blob(gp, MI_WIDTH(mi), MI_HEIGHT(mi), BUMP_ARRAY_SIZE); gp->state = INITIALISING;