From acf1ddc9c443b435b750f607a6c136d372410fee Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 20 Aug 2021 17:58:45 -0500 Subject: [PATCH] Don't scroll vertically on horizontal scroll motions (#10979) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary of the Pull Request Pretty straightforward. Check if the scroll event is a horizontal movement. If it is, ignore it. We don't have a horizontal scrollbar. ## References * obviously, revisit this if we ever do #1860 ## PR Checklist * [x] Closes #10329 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Validation Steps Performed * scrolled ↑/↓ with slaptop trackpad: terminal scrolls. * scrolled ←/→ with slaptop trackpad: terminal doesn't scroll. * Scrolling _slightly more vertically than horizontally_ still scrolls. * Scrolling _slightly more horizontally than vertically_ doesn't scroll. --- src/cascadia/TerminalControl/TermControl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index e54515bcd..aaa562c34 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -1223,6 +1223,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation _RestorePointerCursorHandlers(*this, nullptr); const auto point = args.GetCurrentPoint(*this); + // GH#10329 - we don't need to handle horizontal scrolls. Only vertical ones. + // So filter out the horizontal ones. + if (point.Properties().IsHorizontalMouseWheel()) + { + return; + } auto result = _interactivity.MouseWheel(ControlKeyStates{ args.KeyModifiers() }, point.Properties().MouseWheelDelta(),