Why gay men are called 'poofters'? what does that word mean ?

I know 'poofter' is derogatory homophobic word for gay dudes, but what does 'poofter' mean. some say it has something to do with farts 'poof'?