Fix -topLevel option
[xboard.git] / ngamelist.c
index 72529a4..0d466f5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * ngamelist.c -- Game list window, Xt-independent front-end code for XBoard
  *
- * Copyright 1995, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ * Copyright 1995, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
  * ------------------------------------------------------------------------
  *
  * GNU XBoard is free software: you can redistribute it and/or modify
@@ -151,7 +151,7 @@ static int
 GameListCreate (char *name)
 {
     int new;
-    if(new = GenericPopUp(gamesOptions, name, GameListDlg, BoardWindow, NONMODAL, 1))
+    if(new = GenericPopUp(gamesOptions, name, GameListDlg, BoardWindow, NONMODAL, appData.topLevel))
        AddHandler(&gamesOptions[1], GameListDlg, 4),
        AddHandler(&gamesOptions[0], GameListDlg, 5);
     FocusOnWidget(&gamesOptions[0], GameListDlg);
@@ -195,7 +195,7 @@ GameListPrepare (int byPos, int narrow)
        lg->position = pos;
        lg = (ListGame *) lg->node.succ;
     }
-GetTimeMark(&t2);printf("GameListPrepare %ld msec\n", SubtractTimeMarks(&t2,&t));
+    if(appData.debugMode) { GetTimeMark(&t2);printf("GameListPrepare %ld msec\n", SubtractTimeMarks(&t2,&t)); }
     DisplayTitle("XBoard");
     *st = NULL;
     return listLength;
@@ -244,6 +244,12 @@ GameListPopUp (FILE *fp, char *filename)
     MarkMenu("View.GameList", GameListDlg);
 }
 
+FILE *
+GameFile ()
+{
+  return glc ? glc->fp : NULL;
+}
+
 void
 GameListDestroy ()
 {
@@ -272,7 +278,7 @@ ShowGameListProc ()
        PopDown(GameListDlg);
        return;
     }
-    GenericPopUp(NULL, NULL, GameListDlg, BoardWindow, NONMODAL, 1); // first two args ignored when shell exists!
+    GenericPopUp(NULL, NULL, GameListDlg, BoardWindow, NONMODAL, appData.topLevel); // first two args ignored when shell exists!
     MarkMenu("View.GameList", GameListDlg);
     GameListHighlight(lastLoadGameNumber);
 }
@@ -352,7 +358,7 @@ SaveGameListAsText (FILE *f)
 
     /* Copy the list into the global memory block */
     if( f != NULL ) {
+
         lg = (ListGame *) gameList.head;
 
         for (nItem = 0; nItem < ((ListGame *) gameList.tailPred)->number; nItem++){
@@ -369,4 +375,3 @@ SaveGameListAsText (FILE *f)
     }
     return False;
 }
-