Skip to content

Commit ba7dc25

Browse files
tjamesmacThomas McAuliffe
authored andcommitted
Fix horizontal scrolling on trackpad (#8403)
Adds check to mouse scrolling to see if horizontal scrolling is possible Fix #7772 Co-authored-by: Thomas McAuliffe <tjamc@amazon.com>
1 parent e550335 commit ba7dc25

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

dev/WebView2/WebView2.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,18 @@ void WebView2::HandlePointerWheelChanged(const winrt::Windows::Foundation::IInsp
335335
{
336336
// Chromium handles WM_MOUSEXXX for mouse, WM_POINTERXXX for touch
337337
winrt::PointerDeviceType deviceType{ args.Pointer().PointerDeviceType() };
338-
UINT message = deviceType == winrt::PointerDeviceType::Mouse ? WM_MOUSEWHEEL : WM_POINTERWHEEL;
338+
winrt::PointerPoint pointerPoint{ args.GetCurrentPoint(*this) };
339+
winrt::PointerPointProperties properties{ pointerPoint.Properties() };
340+
UINT message;
341+
342+
if (deviceType == winrt::PointerDeviceType::Mouse)
343+
{
344+
message = properties.IsHorizontalMouseWheel() ? WM_MOUSEHWHEEL : WM_MOUSEWHEEL;
345+
}
346+
else
347+
{
348+
message = WM_POINTERWHEEL;
349+
}
339350
OnXamlPointerMessage(message, args);
340351
}
341352

0 commit comments

Comments
 (0)