They'd cover it up or abdicate. They couldn't openly remain on the throne as gay entirely because of the heir they would have to have themselves.
I mean look at the complete mess that went on with Prince Charles keeping his relationship with Camilla a secret because he had to marry an unmarried virgin to have his heir.
Although, having said that things are always evolving and changing. Especially with their very limited power these days the rules will get a lot more "accepting" for want of a better term. The main thing standing in the way would be the fact that they remain head of the Church of England.
But then you can't forget that a King created this church purely to bend the rules and do as he pleases. In conclusion, anything could happen.