1640s, "play on words, pun," shortened from whimwham "fanciful object" (q.v.). Meaning "caprice, fancy, sudden turn or inclination of the mind" first recorded 1690s, probably a shortened form of whimsy.
Whiggery
Whiggish
while
whilom
whilst
whim
whimper
whimsical
whimsy
whimwham
whine