X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=26adc7601019d4a4e345d663e6cf2754684f83e6;hb=377bf9818b41e22a35bf96ede1252cd7088e8a66;hp=4a6d7f0403672fecb392d5999c1b9318b452d2b2;hpb=4d04bc8a6c2d5e410d519b25164613c5e5c2d160;p=xboard.git diff --git a/xboard.c b/xboard.c index 4a6d7f0..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