 The marriage was engineered in 1323 when the brothers Lev and Andrew of Galicia were slain without leaving heirs.Instead of replacing them with his own son Liubartas and risking a war with Poland, Gediminas forged a compromise with Władysław I of Poland.Both parties agreed to install Bolesław, cousin of Władysław I and nephew of Gediminas' son-in-law Wacław of Płock, with the marriage to take place later.