bool m_lastKeyDownConsumed;
+ // the timestamp that consists of the last wheel event
+ // added to the time taken to process that event.
+ long m_lastWheelTimestamp;
+
friend class ScintillaWX;
friend class Platform;
#endif // !SWIG
m_swx = new ScintillaWX(this);
m_stopWatch.Start();
m_lastKeyDownConsumed = false;
+ m_lastWheelTimestamp = 0;
m_vScrollBar = NULL;
m_hScrollBar = NULL;
#if wxUSE_UNICODE
}
-void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt) {
- m_swx->DoMouseWheel(evt.GetWheelRotation(),
- evt.GetWheelDelta(),
- evt.GetLinesPerAction(),
- evt.ControlDown(),
- evt.IsPageScroll());
+void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt)
+{
+ // prevent having an event queue with wheel events that cannot be processed
+ // reasonably fast (see ticket #9057)
+ if ( m_lastWheelTimestamp <= evt.GetTimestamp() )
+ {
+ m_lastWheelTimestamp = m_stopWatch.Time();
+ m_swx->DoMouseWheel(evt.GetWheelRotation(),
+ evt.GetWheelDelta(),
+ evt.GetLinesPerAction(),
+ evt.ControlDown(),
+ evt.IsPageScroll());
+ m_lastWheelTimestamp = m_stopWatch.Time() - m_lastWheelTimestamp;
+ m_lastWheelTimestamp += evt.GetTimestamp();
+ }
}
m_swx = new ScintillaWX(this);
m_stopWatch.Start();
m_lastKeyDownConsumed = false;
+ m_lastWheelTimestamp = 0;
m_vScrollBar = NULL;
m_hScrollBar = NULL;
#if wxUSE_UNICODE
}
-void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt) {
- m_swx->DoMouseWheel(evt.GetWheelRotation(),
- evt.GetWheelDelta(),
- evt.GetLinesPerAction(),
- evt.ControlDown(),
- evt.IsPageScroll());
+void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt)
+{
+ // prevent having an event queue with wheel events that cannot be processed
+ // reasonably fast (see ticket #9057)
+ if ( m_lastWheelTimestamp <= evt.GetTimestamp() )
+ {
+ m_lastWheelTimestamp = m_stopWatch.Time();
+ m_swx->DoMouseWheel(evt.GetWheelRotation(),
+ evt.GetWheelDelta(),
+ evt.GetLinesPerAction(),
+ evt.ControlDown(),
+ evt.IsPageScroll());
+ m_lastWheelTimestamp = m_stopWatch.Time() - m_lastWheelTimestamp;
+ m_lastWheelTimestamp += evt.GetTimestamp();
+ }
}
bool m_lastKeyDownConsumed;
+ // the timestamp that consists of the last wheel event
+ // added to the time taken to process that event.
+ long m_lastWheelTimestamp;
+
friend class ScintillaWX;
friend class Platform;
#endif // !SWIG