I have noticed this in one species, cynopterus marginatus, one of which flew into my room not long ago, and which repeatedly dashed itself against a glass door in its efforts to escape.
"Natural History of the Mammalia of India and Ceylon"
Robert A. Sterndale