X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxboard.c;h=b1f7103b57798d72bcf0c57d053ce56973aacaf5;hb=8f28573d2b5b136a4997bc720a3037f9ba086532;hp=0d04c5b5742593be80da2f8a41e4b2c81d186de6;hpb=c980334f5f262361b64aad63665eebe40b31ca5d;p=xboard.git diff --git a/gtk/xboard.c b/gtk/xboard.c index 0d04c5b..b1f7103 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -639,7 +639,12 @@ void ResizeBoardWindow (int w, int h, int inhibit) { GtkAllocation a; + int bw; // if(clockKludge) return; // ignore as long as clock does not have final height + gtk_widget_get_allocation(optList[W_BOARD].handle, &a); + bw = a.width; + gtk_widget_get_allocation(shellWidget, &a); + marginW = a.width - bw; gtk_widget_get_allocation(optList[W_WHITE].handle, &a); w += marginW + 1; // [HGM] not sure why the +1 is (sometimes) needed... h += marginH + a.height + 1; @@ -1179,7 +1184,7 @@ main (int argc, char **argv) gtk_widget_get_allocation(optList[W_WHITE].handle, &a); clockKludge = hc = a.height; gtk_widget_get_allocation(boardWidget, &a); - marginW = w - boardWidth; // [HGM] needed to set new shellWidget size when we resize board +// marginW = w - boardWidth; // [HGM] needed to set new shellWidget size when we resize board marginH = h - a.height - hc; // subtract current clock height, so it can be added back dynamically } @@ -1647,10 +1652,13 @@ ReSize (WindowPlacement *wp) if(sqy < sqx) sqx = sqy; if(sqx < 20) return; if(appData.overrideLineGap < 0) { // do second iteration with adjusted lineGap + int oldSqx = sqx; lg = lineGap = sqx < 37 ? 1 : sqx < 59 ? 2 : sqx < 116 ? 3 : 4; sqx = (wp->width - lg - marginW) / BOARD_WIDTH - lg; sqy = (wp->height - lg - marginH - hc) / BOARD_HEIGHT - lg; if(sqy < sqx) sqx = sqy; + lg = sqx < 37 ? 1 : sqx < 59 ? 2 : sqx < 116 ? 3 : 4; + if(sqx == oldSqx + 1 && lg == lineGap + 1) sqx = oldSqx, squareSize = 0; // prevent oscillations, force resize by kludge } if(sqx != squareSize) { squareSize = sqx; // adopt new square size