diff --git a/common/view/wx_view_controls.cpp b/common/view/wx_view_controls.cpp index 7ed899165e..85e2ac8cc3 100644 --- a/common/view/wx_view_controls.cpp +++ b/common/view/wx_view_controls.cpp @@ -52,7 +52,7 @@ static std::unique_ptr GetZoomControllerForPlatform() WX_VIEW_CONTROLS::WX_VIEW_CONTROLS( VIEW* aView, wxScrolledCanvas* aParentPanel ) : VIEW_CONTROLS( aView ), m_state( IDLE ), m_parentPanel( aParentPanel ), - m_scrollScale( 1.0, 1.0 ), m_cursorPos( 0, 0 ), m_updateCursor( true ) + m_scrollScale( 1.0, 1.0 ), m_lastTimestamp( 0 ), m_cursorPos( 0, 0 ), m_updateCursor( true ) { m_parentPanel->Connect( wxEVT_MOTION, wxMouseEventHandler( WX_VIEW_CONTROLS::onMotion ), NULL, this ); @@ -133,6 +133,16 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent ) { const double wheelPanSpeed = 0.001; +#ifdef __WXGTK3__ + if( aEvent.GetTimestamp() == m_lastTimestamp ) + { + aEvent.Skip( false ); + return; + } + + m_lastTimestamp = aEvent.GetTimestamp(); +#endif + // mousewheelpan disabled: // wheel + ctrl -> horizontal scrolling; // wheel + shift -> vertical scrolling; diff --git a/include/view/wx_view_controls.h b/include/view/wx_view_controls.h index d3b7d07335..755e69dee1 100644 --- a/include/view/wx_view_controls.h +++ b/include/view/wx_view_controls.h @@ -159,6 +159,9 @@ private: /// Current scrollbar position VECTOR2I m_scrollPos; + /// Last event timestamp to remove duplicates + long int m_lastTimestamp; + /// Current cursor position (world coordinates) VECTOR2D m_cursorPos;