X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwinboard.c;h=813445bb8c79a6fdd1856c1627f3231fc8299d26;hb=14dfd6a519e8180e1505c32a36527d7662d9e008;hp=ad14f7e94f6bbcc559b6bc00ce70f21e10cd2fb3;hpb=d413d3ed517beac460ae9ed147e6200a57125bb5;p=xboard.git diff --git a/winboard/winboard.c b/winboard/winboard.c index ad14f7e..813445b 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -155,7 +155,7 @@ BOOLEAN chessProgram; static int boardX, boardY; int minX, minY; // [HGM] placement: volatile limits on upper-left corner static int squareSize, lineGap, minorSize; -static int winWidth, winHeight; +static int winWidth, winHeight, winW, winH; static RECT messageRect, whiteRect, blackRect, leftLogoRect, rightLogoRect; // [HGM] logo static int logoHeight = 0; static char messageText[MESSAGE_TEXT_MAX]; @@ -700,9 +700,9 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) size that fits on this screen as the default. */ InitDrawingSizes((BoardSize)(ibs+1000), 0); if (boardSize == (BoardSize)-1 && - winHeight <= screenHeight + winH <= screenHeight - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYCAPTION) - 10 - && winWidth <= screenWidth) { + && winW <= screenWidth) { boardSize = (BoardSize)ibs; } } @@ -3234,10 +3234,12 @@ InitDrawingSizes(BoardSize boardSize, int flags) sizeInfo[boardSize].cliHeight = boardRect.bottom + OUTER_MARGIN; oldBoardSize = boardSize; oldTinyLayout = tinyLayout; - if(suppressVisibleEffects) return; // [HGM] when called for filling sizeInfo only - winWidth = 2 * GetSystemMetrics(SM_CXFRAME) + boardRect.right + OUTER_MARGIN; - winHeight = 2 * GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYMENU) + + winW = 2 * GetSystemMetrics(SM_CXFRAME) + boardRect.right + OUTER_MARGIN; + winH = 2 * GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYMENU) + GetSystemMetrics(SM_CYCAPTION) + boardRect.bottom + OUTER_MARGIN; + if(suppressVisibleEffects) return; // [HGM] when called for filling sizeInfo only + winWidth = winW; // [HGM] placement: set through temporary which can used by initial sizing choice + winHeight = winH; // without disturbing window attachments GetWindowRect(hwndMain, &wrect); SetWindowPos(hwndMain, NULL, 0, 0, winWidth, winHeight, SWP_NOCOPYBITS|SWP_NOZORDER|SWP_NOMOVE); @@ -8113,14 +8115,12 @@ ConsoleWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) wp.rcNormalPosition.bottom = wpConsole.y + wpConsole.height; SetWindowPlacement(hDlg, &wp); } -#if 0 - // [HGM] Chessknight's change 2004-07-13 else { /* Determine Defaults */ WINDOWPLACEMENT wp; wpConsole.x = winWidth + 1; wpConsole.y = boardY; - wpConsoleW = screenWidth - winWidth; - wpConsoleH = winHeight; + wpConsole.width = screenWidth - winWidth; + wpConsole.height = winHeight; EnsureOnScreen(&wpConsole.x, &wpConsole.y, 0, 0); wp.length = sizeof(WINDOWPLACEMENT); wp.flags = 0; @@ -8132,7 +8132,6 @@ ConsoleWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) wp.rcNormalPosition.bottom = wpConsole.y + wpConsole.height; SetWindowPlacement(hDlg, &wp); } -#endif return FALSE; case WM_SETFOCUS: