X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fgtkwin.c;h=4cce11e6e52b9431fab0df0423ced7c835a81605;hb=068b67d2f6e9b186b3107ebcb1e88a141b7b5ebc;hp=fe597bf26206179f63290ee37b9320211211d525;hpb=4647eded7cdc590d80327291ebe7996049de3850;p=PuTTY.git diff --git a/unix/gtkwin.c b/unix/gtkwin.c index fe597bf2..4cce11e6 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -1477,15 +1477,20 @@ static gint timer_trigger(gpointer data) long ticks; /* - * Remove the timer we got here on; if we need another one, we'll - * set it up below. + * Destroy the timer we got here on. */ if (timer_id) { gtk_timeout_remove(timer_id); timer_id = 0; } - if (run_timers(now, &next)) { + /* + * 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)