Use idle_add from GLib.