but does it ever happen in safe mode? if not, then that shows one of the things it disables is the culprit.
and you can disable hardware acceleration alone and see if that's the cause, or some extensions, as further diagnostics.
weird, there's an old bug with the same issue https://bugzilla.mozilla.org/show_bug.cgi?id=212556
might be a related regression
on the other hand, if you're using a plugin like flash, they can play dirty tricks with focus handling