okay so this mechanic is just bugged, right?
Not only did I have to fight a succession war because it gave Hungary to Poland despite the previous king having a valid male heir, but now that I've gotten Hungary in my union they're STILL going to go to Poland when my current king dies, even though he has a male heir.