Fix repositioning of GTK windows
[xboard.git] / gtk / xoptions.c
index 8b231f9..fae7d9f 100644 (file)
@@ -634,7 +634,7 @@ AddHandler (Option *opt, DialogClass dlg, int nr)
 GtkWidget *shells[NrOfDialogs];
 DialogClass parents[NrOfDialogs];
 WindowPlacement *wp[NrOfDialogs] = { // Beware! Order must correspond to DialogClass enum
-    NULL, &wpComment, &wpTags, NULL, NULL, NULL, NULL, &wpMoveHistory, &wpGameList, &wpEngineOutput, &wpEvalGraph,
+    NULL, &wpComment, &wpTags, NULL, NULL, NULL, &wpDualBoard, &wpMoveHistory, &wpGameList, &wpEngineOutput, &wpEvalGraph,
     NULL, NULL, NULL, NULL, &wpMain
 };
 
@@ -1105,6 +1105,7 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent
     if(dlgNr && dlgNr < PromoDlg && shells[dlgNr]) { // reusable, and used before (but popped down)
         gtk_widget_show(shells[dlgNr]);
         shellUp[dlgNr] = True;
+       if(wp[dlgNr]) gtk_window_move(GTK_WINDOW(shells[dlgNr]), wp[dlgNr]->x, wp[dlgNr]->y);
         return 0;
     }
 
@@ -1506,12 +1507,14 @@ printf("n=%d, h=%d, w=%d\n",n,height,width);
 
     /* hide OK/cancel buttons */
     if(!topLevel)
-      if((option[i].min & NO_OK)) {
-        actionarea = gtk_dialog_get_action_area(GTK_DIALOG(dialog));
-        gtk_widget_hide(actionarea);
-      } else if((option[i].min & NO_CANCEL)) {
-        button = gtk_dialog_get_widget_for_response(GTK_DIALOG(dialog), GTK_RESPONSE_REJECT);
-        gtk_widget_hide(button);
+      {
+       if((option[i].min & NO_OK)) {
+         actionarea = gtk_dialog_get_action_area(GTK_DIALOG(dialog));
+         gtk_widget_hide(actionarea);
+       } else if((option[i].min & NO_CANCEL)) {
+         button = gtk_dialog_get_widget_for_response(GTK_DIALOG(dialog), GTK_RESPONSE_REJECT);
+         gtk_widget_hide(button);
+       }
         g_signal_connect (dialog, "response",
                       G_CALLBACK (GenericPopDown),
                       (gpointer)(intptr_t) dlgNr);