Ubuntu 14.04 mouse and window focus issues

So I kept looking around and the problem seems to have been the type of mouse I have. I found a thread on the Ubuntu forums by a user with a similar mouse having a problem that sounded like mine. In the thread it was suggested to (create and) edit the /etc/X11/xorg.conf files with the following:

Section "InputClass"
    Identifier "Mouse Remap"
    MatchProduct "Saitek Cyborg R.A.T.5 Mouse"
    MatchDevicePath "/dev/input/event*"
    Option "ButtonMapping" "1 2 3 4 5 6 7 2 9 10 11 12 0 0 0"
EndSection

And then I restarted my computer.

I have RAT5 gaming mouse and the use from the thread has the RAT7 gaming mouse. It has been a day since I implemented the fix and there have been no problems. Didn't bother looking into why it was buggy but I know the above configuration fixed it.

Thread: http://ubuntuforums.org/showthread.php?t=2152976