Share autofocus

cc @jancborchardt @karlitschek @Kondou-ger @petemcfarlane 

fix #4941 fix #4465 

backport of #4803