X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxboard.c;h=485e94259b51ba0f13002f9cf287309ec8070830;hb=a6e61c9b9dac10313dedc401f47d82038753189f;hp=7c515a9334a404c2ebb9d3acfe79d7fd7582da23;hpb=32537912b88a86118f71b82a0bf2232aee27d0e7;p=xboard.git diff --git a/gtk/xboard.c b/gtk/xboard.c index 7c515a9..485e942 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -256,7 +256,6 @@ GtkAccelGroup *GtkAccelerators; typedef unsigned int BoardSize; BoardSize boardSize; Boolean chessProgram; -int initialSquareSize; int minX, minY; // [HGM] placement: volatile limits on upper-left corner int smallLayout = 0, tinyLayout = 0, @@ -666,7 +665,7 @@ ResizeBoardWindow (int w, int h, int inhibit) // h += marginH + a.height + 1; gtk_window_resize(GTK_WINDOW(shellWidget), w, 10); DoEvents(); - gtk_widget_set_size_request(optList[W_BOARD].handle, 100, 100); // liberate board again + if(!appData.fixedSize) gtk_widget_set_size_request(optList[W_BOARD].handle, 100, 100); // liberate board again } int @@ -984,7 +983,9 @@ main (int argc, char **argv) } if ((chessDir = (char *) getenv("CHESSDIR")) == NULL) { - chessDir = "."; + static char dirName[MSG_SIZ]; + getcwd(dirName, MSG_SIZ); + chessDir = dirName; } else { if (chdir(chessDir) != 0) { fprintf(stderr, _("%s: can't cd to CHESSDIR: "), programName); @@ -1152,6 +1153,7 @@ main (int argc, char **argv) menuBarWidget = optList[W_MENU].handle; dropMenu = optList[W_DROP].handle; titleWidget = optList[optList[W_TITLE].type != Skip ? W_TITLE : W_SMALL].handle; + DelayedDrag(); // fake configure event (i3wm tiling window manager fails to send one after initial resize) #ifdef TODO_GTK formWidget = XtParent(boardWidget); XtSetArg(args[0], XtNbackground, &timerBackgroundPixel); @@ -1674,9 +1676,7 @@ ReSize (WindowPlacement *wp) { GtkAllocation a; int sqx, sqy, i, w, h, lg = lineGap; - static int first = 1; -// DisplayBothClocks(); - if(wp->width == wpMain.width && wp->height == wpMain.height && !first) return; // not sized + if(wp->width == wpMain.width && wp->height == wpMain.height) return; // not sized gtk_widget_get_allocation(optList[W_DROP+1].handle, &a); // table that should contain everything w = a.width; h = a.height; gtk_widget_get_allocation(shellWidget, &a); @@ -1702,7 +1702,7 @@ ReSize (WindowPlacement *wp) if(sqx == oldSqx + 1 && lg == lineGap + 1) sqx = oldSqx, squareSize = 0; // prevent oscillations, force resize by kludge } for(h=0; sizeDefaults[h+1].name && sizeDefaults[h].squareSize*8 > sqx*BOARD_WIDTH; h++) {} - if(initialSquareSize != sizeDefaults[h].squareSize) { // boardSize changed + if(initialSquareSize != sizeDefaults[h].squareSize && !appData.fixedSize) { // boardSize changed initialSquareSize = sizeDefaults[h].squareSize; // used for saving font ChangeFont(1, &appData.clockFont, CLOCK_FONT, initialSquareSize, CLOCK_FONT_NAME, 2*(sizeDefaults[h].clockFontPxlSize+1)/3); ChangeFont(1, &appData.font, MESSAGE_FONT, initialSquareSize, DEFAULT_FONT_NAME, sizeDefaults[h].coordFontPxlSize); @@ -1736,7 +1736,7 @@ ReSize (WindowPlacement *wp) } } #endif - if(sqx != squareSize && !first) { + if(sqx != squareSize && !appData.fixedSize) { squareSize = sqx; // adopt new square size CreatePNGPieces(appData.pieceDirectory); // make newly scaled pieces InitDrawingSizes(0, 0); // creates grid etc. @@ -1745,7 +1745,6 @@ ReSize (WindowPlacement *wp) h = BOARD_HEIGHT * (squareSize + lineGap) + lineGap; if(optList[W_BOARD].max > w) optList[W_BOARD].max = w; if(optList[W_BOARD].value > h) optList[W_BOARD].value = h; - first = appData.fixedSize; if(twoBoards && shellUp[DummyDlg]) { SlavePopUp(); dualOptions[3].max = 0; DoEvents(); // calls SlaveResize, kludge to force assigning new canvas partnerUp = !partnerUp; flipView = !flipView;