Skip to content

Commit

Permalink
Fix horizontal scrolling on trackpad (#8403)
Browse files Browse the repository at this point in the history
Adds check to mouse scrolling to see if horizontal scrolling is possible

Fix #7772

Co-authored-by: Thomas McAuliffe <[email protected]>
  • Loading branch information
2 people authored and Keith Mahoney committed Jun 22, 2023
1 parent e550335 commit ba7dc25
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion dev/WebView2/WebView2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,18 @@ void WebView2::HandlePointerWheelChanged(const winrt::Windows::Foundation::IInsp
{
// Chromium handles WM_MOUSEXXX for mouse, WM_POINTERXXX for touch
winrt::PointerDeviceType deviceType{ args.Pointer().PointerDeviceType() };
UINT message = deviceType == winrt::PointerDeviceType::Mouse ? WM_MOUSEWHEEL : WM_POINTERWHEEL;
winrt::PointerPoint pointerPoint{ args.GetCurrentPoint(*this) };
winrt::PointerPointProperties properties{ pointerPoint.Properties() };
UINT message;

if (deviceType == winrt::PointerDeviceType::Mouse)
{
message = properties.IsHorizontalMouseWheel() ? WM_MOUSEHWHEEL : WM_MOUSEWHEEL;
}
else
{
message = WM_POINTERWHEEL;
}
OnXamlPointerMessage(message, args);
}

Expand Down

0 comments on commit ba7dc25

Please sign in to comment.