From: H.G. Muller Date: Wed, 24 Mar 2010 10:04:00 +0000 (+0100) Subject: Fix window-position upset on failing engine start in WinBoard X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=e163486f1f5f391ca2ade9aa8be94b36acc16823;p=xboard.git Fix window-position upset on failing engine start in WinBoard The main window was only positoned according to the settings-file data after the engine was started up from InitBackend2(), so that if the latter gave a fatal error, and Save Settings on Exit was on, a wrong position for the main window would be saved. The call to InitBackend2() is now moved until after setting the main-window position. --- diff --git a/winboard/winboard.c b/winboard/winboard.c index e943a22..e7e4ca7 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -836,8 +836,6 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) EngineOutputPopUp(); } - InitBackEnd2(); - /* Make the window visible; update its client area; and return "success" */ EnsureOnScreen(&wpMain.x, &wpMain.y, minX, minY); wp.length = sizeof(WINDOWPLACEMENT); @@ -850,6 +848,8 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) wp.rcNormalPosition.bottom = wpMain.y + wpMain.height; SetWindowPlacement(hwndMain, &wp); + InitBackEnd2(); // [HGM] moved until after all windows placed, to save correct position if fatal error on engine start + if(!appData.noGUI) SetWindowPos(hwndMain, alwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);