X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=26adc7601019d4a4e345d663e6cf2754684f83e6;hb=377bf9818b41e22a35bf96ede1252cd7088e8a66;hp=21bc9bb0ba761bed0808c30e2c5eebd831647a4e;hpb=e3fe733c547d0f8c91c1ff5374a569477a7c1cea;p=xboard.git diff --git a/xboard.c b/xboard.c index 21bc9bb..26adc76 100644 --- a/xboard.c +++ b/xboard.c @@ -1682,9 +1682,17 @@ void InitDrawingSizes(BoardSize boardSize, int flags) Arg args[16]; XtGeometryResult gres; int i; + static Dimension oldWidth, oldHeight; + static VariantClass oldVariant; + static int oldDual = -1; if(!formWidget) return; + if(appData.overrideLineGap >= 0) lineGap = appData.overrideLineGap; + boardWidth = lineGap + BOARD_WIDTH * (squareSize + lineGap); + boardHeight = lineGap + BOARD_HEIGHT * (squareSize + lineGap); + + if(boardWidth != oldWidth || boardHeight != oldHeight || oldDual != twoBoards) { // do resizing stuff only if size actually changed /* * Enable shell resizing. */ @@ -1699,9 +1707,7 @@ void InitDrawingSizes(BoardSize boardSize, int flags) XtSetArg(args[0], XtNdefaultDistance, &sep); XtGetValues(formWidget, args, 1); - if(appData.overrideLineGap >= 0) lineGap = appData.overrideLineGap; - boardWidth = lineGap + BOARD_WIDTH * (squareSize + lineGap); - boardHeight = lineGap + BOARD_HEIGHT * (squareSize + lineGap); + oldWidth = boardWidth; oldHeight = boardHeight; oldDual = twoBoards; CreateGrid(); hOffset = boardWidth + 10; for(i=0; i