]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Protect against multiple Change Settings dialogues. We should probably also
authorOwen Dunn <owen@greenend.org.uk>
Thu, 10 Mar 2005 10:07:27 +0000 (10:07 +0000)
committerOwen Dunn <owen@greenend.org.uk>
Thu, 10 Mar 2005 10:07:27 +0000 (10:07 +0000)
arrange to switch to an existing Change Settings if the user selects the
menu item and we already have a Change Settings.

[originally from svn r5475]

unix/gtkwin.c

index 93cc68e914984eef55d1583174c6532a20b21c14..91c130545a9b7ea0f31fc7f3cf793684b4a9dd53 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 {
@@ -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, ...)