optimize mousemove listener. fixes #1328