fix bug: gesture is deactivated when focus is changed.