Merge "Do not preserve window when window not added" into main