I occurs to me that being unfulfilled with what you are currently doing is what leads to mind wandering and unhappiness, rather than mind wandering itself being the cause of unhappiness. Mind wandering is a signal that you aren't having fun.
This is not necessarily true. This is especially because tasks that we ultimately find fulfilling, are not often ones that we would define as "fun". Fulfilling, deep, concentration often requires hard work, and forceful concentration, on difficult things. The number of things that are fun, and deeply fulfilling are few and far between.