Are you running version 0.1.9 of mbarcode? Version 0.1.8 had a bug causing the refocusing being called even after a barcode was found, and before clicking the 'Scan' button. This is fixed in the newest version.