There was a thread about just this a while back.
Olaf II of Denmark lives another 30 years and marries Hedwig of Anjou, making him ruler of both the Kalmar Union and Poland. How can we through this scenario end up with a union of Poland and Denmark?www.alternatehistory.com
What about this suggestion?Rather not. Siemowit IV and Wilhelm Habsburg are way more likely if Jogaila happens to be staunch pagan
I'd think a slightly more realistic option probably requires Hedwig to marry Jogaila in 1385, only for the latter to pass away at a suitable time. Vytautas would likely succeed Lithuania if Jogaila died childless, and he is married. With the union with Lithuania broken, it would open the chance for Olaf to become her second husband. The Teutonic Order taking over Gotland like OTL, but in worst circumstances or handling the aftermath worst, could serve to direct Margaret/Olaf's attention against the TO. That might be enough to push Poland towards that marriage.