Thanks for your suggestions, the problem was caused by plugin. After reading your comments, I disabled all the plugins, restarted Geany, and it worked fine. Then I started re-enabling plugins one after one and found that Overview plugin causes this problem. Once I disable it, autofocus starts working. Enable - no autofocus again.
In case you need more details, I'm running latest version of Geany on antergos KDE.