I've had this problem for a long while...
First the computer goes into screensaver. Then when it resumes the currently focused window cannot receive keyboard events of any kind until focus is lost and then gained again.
Anyone seen something like this/knows why it happens?
As a side note, I always password lock the computer when going into screensaver mode.
It`s a famous bug on launchpad. It only remains to wait for the decision :( https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/586528