From: Mark Loli Date: Tue, 13 Jul 2004 05:03:55 +0000 (+0000) Subject: Change the way WinBoard chooses a default board size and size/placement of the ICS... X-Git-Tag: v4.2.8~20 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=18cac83a5bade9078bbdf0c1141f521ec4a818de;p=xboard.git Change the way WinBoard chooses a default board size and size/placement of the ICS Interaction window in the absence of a WinBoard.ini file. --- diff --git a/winboard/winboard.c b/winboard/winboard.c index 55a5b00..a06361f 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -587,7 +587,7 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) InitDrawingSizes((BoardSize)ibs, 0); if (boardSize == (BoardSize)-1 && winHeight <= screenHeight && winWidth <= screenWidth) { - boardSize = (BoardSize)ibs; + boardSize = (BoardSize)ibs - 4 < 0 ? (BoardSize)0 : (BoardSize)ibs - 4; } } InitDrawingSizes(boardSize, 0); @@ -5625,6 +5625,23 @@ ConsoleWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) wp.rcNormalPosition.bottom = consoleY + consoleH; SetWindowPlacement(hDlg, &wp); } + else { /* Determine Defaults */ + WINDOWPLACEMENT wp; + consoleX = winWidth + 1; + consoleY = boardY; + consoleW = screenWidth - winWidth; + consoleH = winHeight; + EnsureOnScreen(&consoleX, &consoleY); + wp.length = sizeof(WINDOWPLACEMENT); + wp.flags = 0; + wp.showCmd = SW_SHOW; + wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; + wp.rcNormalPosition.left = consoleX; + wp.rcNormalPosition.right = consoleX + consoleW; + wp.rcNormalPosition.top = consoleY; + wp.rcNormalPosition.bottom = consoleY + consoleH; + SetWindowPlacement(hDlg, &wp); + } return FALSE; case WM_SETFOCUS: