From: H.G. Muller Date: Wed, 21 Dec 2011 21:17:01 +0000 (+0100) Subject: Fix switching back from mono-mode XB X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=10d981a1f16cf0b7ae006e257d756030e116725f;p=xboard.git Fix switching back from mono-mode XB Suppressing unnecesary X-server calls in InitDrawingSizes had broken switching back from monoMode, because the animVars have to be recreated for that, and this was only done when the variant changed. --- diff --git a/xboard.c b/xboard.c index 9170e7f..ecf421c 100644 --- a/xboard.c +++ b/xboard.c @@ -1686,7 +1686,7 @@ void InitDrawingSizes(BoardSize boardSize, int flags) int i; static Dimension oldWidth, oldHeight; static VariantClass oldVariant; - static int oldDual = -1; + static int oldDual = -1, oldMono = -1; if(!formWidget) return; @@ -1765,7 +1765,7 @@ void InitDrawingSizes(BoardSize boardSize, int flags) // [HGM] pieces: tailor piece bitmaps to needs of specific variant // (only for xpm) - if(gameInfo.variant == oldVariant) return; // and only if variant changed + if(gameInfo.variant != oldVariant) { // and only if variant changed if(useImages) { for(i=0; i<4; i++) { @@ -1833,9 +1833,12 @@ void InitDrawingSizes(BoardSize boardSize, int flags) } } } + } #if HAVE_LIBXPM + if(appData.monoMode == oldMono) CreateAnimVars(); #endif + oldMono = appData.monoMode; } #endif