same problem, solved
I have the same issue, a kvm, mouse goes crazy after switching screens.
I have a Microsoft intellemouse.
On Linux I changed the protocol to auto.
On the every time I switch to Linux the mouse goes crazy, so unplug the mouse from the kvm, pause, plug it back in. (The pause is required.)
No rebooting, the computer resets the mouse automatically when it gets plugged back in.
Try it tell me if it works for you.