From e4c4bd20920e11458ab0ec0cd17c69b8bf7f6d00 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 20 Apr 2014 16:48:18 +0000 Subject: [PATCH] Fix an annoying warning from GTK on Ubuntu 14.04. Timer objects evaporate when our timer_trigger callback is called, and therefore we should not remember their ids beyond that time and attempt to cancel them later. Previous versions of GTK silently ignored us doing that, but upgrading to Ubuntu Trusty has given me a version of GTK that complains about it, so let's stop doing it. [originally from svn r10181] --- unix/gtkwin.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/unix/gtkwin.c b/unix/gtkwin.c index 19ada0b8..4f626cbe 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -1476,6 +1476,14 @@ static gint timer_trigger(gpointer data) unsigned long next, then; long ticks; + /* + * The timer we last scheduled via gtk_timeout_add has just + * triggered, and since we're about to return FALSE, it won't be + * resumed. So zero out its id, in case we don't overwrite it in + * the next loop. + */ + timer_id = 0; + if (run_timers(now, &next)) { then = now; now = GETTICKCOUNT(); -- 2.45.2