Charles I of Hungary
The second Congress of Visegrád was a 1339 summit in Visegrád that decided that if Casimir III of Poland died without a son, the King of Poland would be the son of Charles I of Hungary, Louis I of Hungary, which is what happened.