Mercurial > hg > svgui
changeset 878:241688360929
Discard wildly excessive wheel events
author | Chris Cannam |
---|---|
date | Mon, 10 Nov 2014 09:54:09 +0000 |
parents | d854c72dcaa1 |
children | 899c4d7e7e63 33157c3f0e80 |
files | view/Pane.cpp |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/view/Pane.cpp Fri Oct 03 15:27:02 2014 +0100 +++ b/view/Pane.cpp Mon Nov 10 09:54:09 2014 +0000 @@ -2286,6 +2286,13 @@ // Coarse wheel information (or vertical zoom, which is // necessarily coarse itself) + // Sometimes on Linux we're seeing absurdly extreme angles on + // the first wheel event -- discard those entirely + if (abs(m_pendingWheelAngle) > 1000) { + m_pendingWheelAngle = 0; + return; + } + while (abs(m_pendingWheelAngle) >= 120) { int sign = (m_pendingWheelAngle < 0 ? -1 : 1);