major overhaul of the -stickyWindows feature
[xboard.git] / winboard / wgamelist.c
index 1c8a15d..3c13ae6 100644 (file)
@@ -46,11 +46,11 @@ HWND gameListDialog = NULL;
 BOOLEAN gameListUp = FALSE;\r
 FILE* gameFile;\r
 char* gameFileName = NULL;\r
-int gameListX, gameListY, gameListW, gameListH;\r
 \r
 /* Imports from winboard.c */\r
 extern HINSTANCE hInst;\r
 extern HWND hwndMain;\r
+extern WindowPlacement wpGameList;\r
 \r
 struct GameListStats\r
 {\r
@@ -238,18 +238,18 @@ GameListDialog(HWND hDlg, UINT message,   WPARAM wParam, LPARAM lParam)
       GetClientRect(hDlg, &rect);\r
       sizeX = rect.right;\r
       sizeY = rect.bottom;\r
-      if (gameListX != CW_USEDEFAULT && gameListY != CW_USEDEFAULT &&\r
-         gameListW != CW_USEDEFAULT && gameListH != CW_USEDEFAULT) {\r
+      if (wpGameList.x != CW_USEDEFAULT && wpGameList.y != CW_USEDEFAULT &&\r
+         wpGameList.width != CW_USEDEFAULT && wpGameList.height != CW_USEDEFAULT) {\r
        WINDOWPLACEMENT wp;\r
-       EnsureOnScreen(&gameListX, &gameListY);\r
+       EnsureOnScreen(&wpGameList.x, &wpGameList.y, 0, 0);\r
        wp.length = sizeof(WINDOWPLACEMENT);\r
        wp.flags = 0;\r
        wp.showCmd = SW_SHOW;\r
        wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0;\r
-       wp.rcNormalPosition.left = gameListX;\r
-       wp.rcNormalPosition.right = gameListX + gameListW;\r
-       wp.rcNormalPosition.top = gameListY;\r
-       wp.rcNormalPosition.bottom = gameListY + gameListH;\r
+       wp.rcNormalPosition.left = wpGameList.x;\r
+       wp.rcNormalPosition.right = wpGameList.x + wpGameList.width;\r
+       wp.rcNormalPosition.top = wpGameList.y;\r
+       wp.rcNormalPosition.bottom = wpGameList.y + wpGameList.height;\r
        SetWindowPlacement(hDlg, &wp);\r
 \r
        GetClientRect(hDlg, &rect);\r