From: mfranz Date: Sat, 28 Jan 2006 10:40:47 +0000 (+0000) Subject: write to /sim/startup/xsize only if the size really changed; likewise for X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bae5d4e92ba010d30ff0560a9411b7c51ba5264b;p=flightgear.git 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. --- 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