}
/* 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)
{
}
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)
}
/*
- * 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;
}
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)
*/
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);
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 */