diff --git a/CefSharp.Wpf.Example/Views/BrowserTabView.xaml.cs b/CefSharp.Wpf.Example/Views/BrowserTabView.xaml.cs index 47bddf4af..ede600012 100644 --- a/CefSharp.Wpf.Example/Views/BrowserTabView.xaml.cs +++ b/CefSharp.Wpf.Example/Views/BrowserTabView.xaml.cs @@ -18,6 +18,8 @@ namespace CefSharp.Wpf.Example.Views browser.RequestHandler = new RequestHandler(); browser.RegisterJsObject("bound", new BoundObject()); browser.RegisterAsyncJsObject("boundAsync", new AsyncBoundObject()); + // Enable touch scrolling - once properly tested this will likely become the default + browser.IsManipulationEnabled = true; //browser.LifeSpanHandler = new LifespanHandler(); browser.MenuHandler = new MenuHandler(); diff --git a/CefSharp.Wpf/ChromiumWebBrowser.cs b/CefSharp.Wpf/ChromiumWebBrowser.cs index 2e618f047..f933d414a 100644 --- a/CefSharp.Wpf/ChromiumWebBrowser.cs +++ b/CefSharp.Wpf/ChromiumWebBrowser.cs @@ -1282,5 +1282,27 @@ namespace CefSharp.Wpf { get { return disposeCount > 0; } } + + protected override void OnManipulationDelta(ManipulationDeltaEventArgs e) + { + base.OnManipulationDelta(e); + + if (!e.Handled) + { + var point = e.ManipulationOrigin; + + var browser = GetBrowser(); + + if (browser != null) + { + browser.GetHost().SendMouseWheelEvent( + (int)point.X, + (int)point.Y, + deltaX: (int)e.DeltaManipulation.Translation.X, + deltaY: (int)e.DeltaManipulation.Translation.Y, + modifiers: CefEventFlags.None); + } + } + } } }