The timer method could be helpful. Same with fidget toys (see our “fidget toys” tag). With the timer method, when you start drifting it’s time for a break. If you’re having this much trouble focusing, don’t time your work just time your breaks. You can decide how many times in a row to work on one thing before moving on to another; flitting can be helpful or disruptive, depending on how it plays out, so try to figure out a way to make it work for you.
Followers, do you have this problem? How do you cope?