X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fklein.c;h=366fabda57c70b815642ba6446e5e7040ac0daca;hb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;hp=9753ac69ab8827c180eb414b214d073af7ba99bd;hpb=f0261d8acab611f3433160e4f07367b870439739;p=xscreensaver diff --git a/hacks/glx/klein.c b/hacks/glx/klein.c index 9753ac69..366fabda 100644 --- a/hacks/glx/klein.c +++ b/hacks/glx/klein.c @@ -136,7 +136,9 @@ static const char sccsid[] = "@(#)klein.c 1.1 08/10/04 xlockmore"; #ifdef USE_GL -#include +#ifndef HAVE_COCOA +# include +#endif #include "gltrackball.h" @@ -1032,7 +1034,7 @@ static int figure8(ModeInfo *mi, double umin, double umax, double vmin, sv = sin(v); cv2 = cos(0.5*v); sv2 = sin(0.5*v); - c2u = cos(2.0*u); + /*c2u = cos(2.0*u);*/ s2u = sin(2.0*u); xx[0] = (su*cv2-s2u*sv2+FIGURE_8_RADIUS)*cv; xx[1] = (su*cv2-s2u*sv2+FIGURE_8_RADIUS)*sv; @@ -1699,9 +1701,12 @@ ENTRYPOINT void reshape_klein(ModeInfo *mi, int width, int height) ENTRYPOINT Bool klein_handle_event(ModeInfo *mi, XEvent *event) { - Display *display = MI_DISPLAY(mi); kleinstruct *kb = &klein[MI_SCREEN(mi)]; - KeySym sym; + KeySym sym = 0; + char c = 0; + + if (event->xany.type == KeyPress || event->xany.type == KeyRelease) + XLookupString (&event->xkey, &c, 1, &sym, 0); if (event->xany.type == ButtonPress && event->xbutton.button == Button1) @@ -1720,7 +1725,6 @@ ENTRYPOINT Bool klein_handle_event(ModeInfo *mi, XEvent *event) } else if (event->xany.type == KeyPress) { - sym = XKeycodeToKeysym(display,event->xkey.keycode,0); if (sym == XK_Shift_L || sym == XK_Shift_R) { kb->current_trackball = 1; @@ -1733,7 +1737,6 @@ ENTRYPOINT Bool klein_handle_event(ModeInfo *mi, XEvent *event) } else if (event->xany.type == KeyRelease) { - sym = XKeycodeToKeysym(display,event->xkey.keycode,0); if (sym == XK_Shift_L || sym == XK_Shift_R) { kb->current_trackball = 0;