Don't update state when not focused.

Fixes GH-15.