From bae5d4e92ba010d30ff0560a9411b7c51ba5264b Mon Sep 17 00:00:00 2001 From: mfranz Date: Sat, 28 Jan 2006 10:40:47 +0000 Subject: [PATCH] write to /sim/startup/xsize only if the size really changed; likewise for ysize. This is useful for listeners, e.g. the one that will re-position the FPS dialog. --- src/Main/renderer.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Main/renderer.cxx b/src/Main/renderer.cxx index 9f7ccb0db..7e9c6f997 100644 --- a/src/Main/renderer.cxx +++ b/src/Main/renderer.cxx @@ -796,8 +796,13 @@ FGRenderer::resize( int width, int height ) { glViewport( 0, (GLint)(height - view_h), (GLint)(width), (GLint)(view_h) ); - fgSetInt("/sim/startup/xsize", width); - fgSetInt("/sim/startup/ysize", height); + static int lastwidth = width; + static int lastheight = height; + if (width != lastwidth) + fgSetInt("/sim/startup/xsize", lastwidth = width); + if (height != lastheight) + fgSetInt("/sim/startup/ysize", lastheight = height); + guiInitMouse(width, height); // for all views -- 2.39.5