Only process mouse position once per animation frame

This is for #6538. This is an alternate solution to #6571.