When John Sobieski died in 1697 he desired for his son, James Louis, to be elected King as his successor. However, James' mother refused to support him and instead supported her son-in-law, Maximilian II Emanuel, Elector of Bavaria. Historically, Maximilian's candidature was overshadowed by the French supporting the Prince of Conti and the Russians supporting Augustus the Strong. Eventually after a contested election Augustus ended up as king. But what if Max Emanuel was able to court enough support from the Poles (through his mother-in-law) and either France or Austria so that he actually won the kingship. What would a Bavarian rule of Poland look like and what would it mean for the War of the Spanish Succession or the Great Northern War (would the later even happen)?