switch focus to the board after loading a game
authorH.G. Muller <h.g.muller@hccnet.nl>
Tue, 27 Oct 2009 22:44:28 +0000 (15:44 -0700)
committerArun Persaud <arun@nubati.net>
Tue, 27 Oct 2009 22:44:28 +0000 (15:44 -0700)
winboard/wgamelist.c

index 2fa1533..26c843b 100644 (file)
@@ -420,6 +420,7 @@ GameListDialog(HWND hDlg, UINT message,     WPARAM wParam, LPARAM lParam)
             CmailLoadGame(gameFile, nItem + 1, gameFileName, TRUE);\r
         }\r
         else {\r
+           SetFocus(hwndMain); // [HGM] automatic focus switch\r
             LoadGame(gameFile, nItem + 1, gameFileName, TRUE);\r
         }\r
     }\r
@@ -446,6 +447,7 @@ VOID GameListPopUp(FILE *fp, char *filename)
   if (gameListDialog) {\r
     SendMessage(gameListDialog, WM_INITDIALOG, 0, 0);\r
     if (!gameListUp) ShowWindow(gameListDialog, SW_SHOW);\r
+    else SetFocus(gameListDialog);\r
   } else {\r
     lpProc = MakeProcInstance((FARPROC)GameListDialog, hInst);\r
     CreateDialog(hInst, MAKEINTRESOURCE(DLG_GameList),\r
@@ -483,7 +485,8 @@ VOID GameListDestroy()
 VOID ShowGameListProc()\r
 {\r
   if (gameListUp) {\r
-    GameListPopDown();\r
+    if(gameListDialog) SetFocus(gameListDialog);\r
+//    GameListPopDown();\r
   } else {\r
     if (gameFileName) {\r
       GameListPopUp(gameFile, gameFileName);\r