X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fgtkwin.c;h=f3a17d58434c2fdb1453fac5ea2ce95e794ce227;hb=5904545cc18289541702da284b00490cb25a753e;hp=19ada0b8d5a045151510734ca5b65c04a2e80721;hpb=f272ea88db4620c8b30b09d5ac905f1fc5ee8bb0;p=PuTTY.git diff --git a/unix/gtkwin.c b/unix/gtkwin.c index 19ada0b8..f3a17d58 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -194,7 +194,7 @@ int platform_default_i(const char *name, int def) } /* Dummy routine, only required in plink. */ -void ldisc_update(void *frontend, int echo, int edit) +void frontend_echoedit_update(void *frontend, int echo, int edit) { } @@ -1476,7 +1476,21 @@ static gint timer_trigger(gpointer data) unsigned long next, then; long ticks; - if (run_timers(now, &next)) { + /* + * Destroy the timer we got here on. + */ + if (timer_id) { + gtk_timeout_remove(timer_id); + timer_id = 0; + } + + /* + * run_timers() may cause a call to timer_change_notify, in which + * case a new timer will already have been set up and left in + * timer_id. If it hasn't, and run_timers reports that some timing + * still needs to be done, we do it ourselves. + */ + if (run_timers(now, &next) && !timer_id) { then = now; now = GETTICKCOUNT(); if (now - then > next - then) @@ -1488,8 +1502,9 @@ static gint timer_trigger(gpointer data) } /* - * Never let a timer resume. If we need another one, we've - * asked for it explicitly above. + * Returning FALSE means 'don't call this timer again', which + * _should_ be redundant given that we removed it above, but just + * in case, return FALSE anyway. */ return FALSE; } @@ -3005,7 +3020,7 @@ void reset_terminal_menuitem(GtkMenuItem *item, gpointer data) struct gui_data *inst = (struct gui_data *)data; term_pwron(inst->term, TRUE); if (inst->ldisc) - ldisc_send(inst->ldisc, NULL, 0, 0); + ldisc_echoedit_update(inst->ldisc); } void copy_all_menuitem(GtkMenuItem *item, gpointer data) @@ -3073,7 +3088,7 @@ void change_settings_menuitem(GtkMenuItem *item, gpointer data) */ if (inst->ldisc) { ldisc_configure(inst->ldisc, inst->conf); - ldisc_send(inst->ldisc, NULL, 0, 0); + ldisc_echoedit_update(inst->ldisc); } /* Pass new config data to the terminal */ term_reconfig(inst->term, inst->conf); @@ -3909,7 +3924,7 @@ int pt_main(int argc, char **argv) start_backend(inst); - ldisc_send(inst->ldisc, NULL, 0, 0);/* cause ldisc to notice changes */ + ldisc_echoedit_update(inst->ldisc); /* cause ldisc to notice changes */ /* now we're reday to deal with the child exit handler being * called */