This is still a problem more than a year later, and the provided solutions are temporary, none of them actually solve the problem.
I don't know about anyone else, but it is quite frustrating to me that I never know if I will strike or just stand there because the mouse has lost focus.
Is there a more permanent solution to this problem that switching windowed to fullscreen, clicking here and there etc etc?