I tightly control the amount of context switching I do since you can get derailed by them, for much the same reason. I don't think I have ADHD but I certainly struggle with attention, and that is a strategy I use. Every alt+tab/window switch is an opportunity for me to lose my train of thought.