i have faced this problem in the past but mostly it gets sorted out by itself.
one setting u may check,
there is one setting somewhere in mouse properties where you can change the active window when you hover your mouse pointer over another window.
also check for some running programs in the background, this generally happens when some other program is trying to gain ur attention.