The other one mate. Not this one, not that one, whichone is whatone. Good to see you.
Yeah, AFAIK it became synonymous for homosexual because they were considered to be happier people.
So it was, at least, a logical step in the etymology.
To the best of my knowledge, it was originally homosexual people who applied the term "gay", as a code word. Well, at least in England. This was just after WWI.
In the US, after WWII, they used "Friend of Dorothy". As far up to Reagan being in power, the US were looking for a ringleader named "Dorothy" who was supposedly responsible for an underground homosexual movement in their military.
The US Civil War song, When Johnny Comes Marching Home, has lines about gay, meaning happy.
So did The Flintstone's theme song - "We'll have a gay old time".
Funny, even intercourse didn't used to mean sex, it meant conversation in the old days.