Thanks to D H Becker for sending in an icon. I'd have liked to have
[u/mdw/putty] / unix / gtkwin.c
index 043f519..91c1305 100644 (file)
@@ -95,6 +95,7 @@ struct gui_data {
     char *progname, **gtkargvstart;
     int ngtkargs;
     guint32 input_event_time; /* Timestamp of the most recent input event. */
+    int reconfiguring;
 };
 
 struct draw_ctx {
@@ -1169,7 +1170,7 @@ void notify_remote_exit(void *frontend)
        inst->exited = TRUE;
        if (inst->cfg.close_on_exit == FORCE_ON ||
            (inst->cfg.close_on_exit == AUTO && exitcode == 0))
-           exit(0);                   /* just go. */
+           gtk_main_quit();           /* just go */
        if (inst->ldisc) {
            ldisc_free(inst->ldisc);
            inst->ldisc = NULL;
@@ -2878,6 +2879,11 @@ void change_settings_menuitem(GtkMenuItem *item, gpointer data)
 
     assert(lenof(ww) == NCFGCOLOURS);
 
+    if (inst->reconfiguring)
+      return;
+    else
+      inst->reconfiguring = TRUE;
+
     cfg2 = inst->cfg;                  /* structure copy */
 
     if (do_config_box(title, &cfg2, 1,
@@ -2995,6 +3001,7 @@ void change_settings_menuitem(GtkMenuItem *item, gpointer data)
        gtk_widget_queue_draw(inst->area);
     }
     sfree(title);
+    inst->reconfiguring = FALSE;
 }
 
 void fork_and_exec_self(struct gui_data *inst, int fd_to_close, ...)