Check for updates only if document has focus. Fixes #229.
Merge pull request #269 from pgiraud/check_update_focus

Check for updates only if document has focus. Fixes #229.