Fixes #17416. Fix detection of finger move after change of direction of scrolling. Thanks Sebastien Brunot (IBM, CCLA)
(cherry picked from commit c895d8004e4d05a6fec50edd36abab33a46b43fe)