X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fsurfaces.c;fp=hacks%2Fglx%2Fsurfaces.c;h=4c7974038f48cd4cda9f0beb0b08ae83cff9ddf9;hp=165264895d15b0838f3771f75a48ff3261d12569;hb=39809ded547bdbb08207d3e514950425215b4410;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba diff --git a/hacks/glx/surfaces.c b/hacks/glx/surfaces.c index 16526489..4c797403 100644 --- a/hacks/glx/surfaces.c +++ b/hacks/glx/surfaces.c @@ -46,7 +46,7 @@ "*showFPS: False \n" \ "*suppressRotationAnimation: True\n" \ -# define refresh_surface 0 +# define free_surface 0 # define release_surface 0 # include "xlockmore.h" /* from the xscreensaver distribution */ #else /* !STANDALONE */ @@ -421,10 +421,17 @@ ENTRYPOINT void reshape_surface(ModeInfo *mi, int width, int height) { surfacestruct *sp = &surface[MI_SCREEN(mi)]; GLfloat h = (GLfloat) height / (GLfloat) width; + int y = 0; + + if (width > height * 5) { /* tiny window: show middle */ + height = width * 9/16; + y = -height/2; + h = height / (GLfloat) width; + } glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(sp->glx_context)); - glViewport(0, 0, (GLint) width, (GLint) height); + glViewport(0, y, (GLint) width, (GLint) height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective (30.0, 1/h, 1.0, 100.0); @@ -463,7 +470,7 @@ ENTRYPOINT void init_surface(ModeInfo *mi) int screen = MI_SCREEN(mi); surfacestruct *sp; - MI_INIT (mi, surface, NULL); + MI_INIT (mi, surface); sp = &surface[screen]; sp->window = MI_WINDOW(mi);