Set parent windows correctly