Handle z order changes properly by waiting until the reordering is complete and then examining the result.