wool-gathering (n.)

also woolgathering, 1550s, "indulging in wandering fancies and purposeless thinking," from the literal meaning "gathering fragments of wool torn from sheep by bushes, etc.," an activity that necessitates much wandering to little purpose. See wool + gather.