I was fiddling with the Java IDE Jgrasp on Ubuntu and one of the things that had been driving me crazy was the setting for "focus follows mouse".
No matter how careful I am, my mouse would end up drifting into some other jgrasp pane and my typing would be lost.
I finally found the setting for it, hidden under the menu Settings/Desktop/Focus Follows Mouse and it was unselected.
This was a little baffling so I checked it and unchecked it. That seemed to fix it. Yes!