-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();
+ }