A more simple way that I usually do is that detach and drag all of those files to my second screen. It will take you sometime at first, but after that the cursor won't randomly jump to another file.
Hi, I also faced exact the same issue and I found this.Detach and then drag those files to the bottom corner, and even hide it if you want.Next time the cursor will remain in main.c file.