diff --git a/src/Uno.UI.Runtime.Skia.Wpf/Input/WpfCorePointerInputSource.cs b/src/Uno.UI.Runtime.Skia.Wpf/Input/WpfCorePointerInputSource.cs index 895cf0d2f264..195809448d27 100644 --- a/src/Uno.UI.Runtime.Skia.Wpf/Input/WpfCorePointerInputSource.cs +++ b/src/Uno.UI.Runtime.Skia.Wpf/Input/WpfCorePointerInputSource.cs @@ -6,6 +6,7 @@ using System.Windows; using System.Windows.Input; using System.Windows.Interop; +using System.Windows.Media; using Uno.Foundation.Logging; using Uno.UI.Dispatching; using Uno.UI.Hosting; @@ -17,6 +18,8 @@ using Windows.System; using Windows.UI.Core; using Windows.UI.Input; +using Uno.UI.Runtime.Skia.Wpf; +using Uno.UI.Runtime.Skia.Wpf.Hosting; using Point = System.Windows.Point; using Rect = Windows.Foundation.Rect; using WpfControl = System.Windows.Controls.Control; @@ -110,9 +113,16 @@ public void ReleasePointerCapture(PointerIdentifier pointer) public void ReleasePointerCapture() => _hostControl.ReleaseMouseCapture(); + private RoutedEventArgs? _lastArgs; + #region Native events private void HostOnMouseEvent(InputEventArgs args, TypedEventHandler? @event, [CallerArgumentExpression(nameof(@event))] string eventName = "") { + if (_lastArgs == args) + { + return; + } + _lastArgs = args; var current = SynchronizationContext.Current; try { @@ -123,7 +133,27 @@ private void HostOnMouseEvent(InputEventArgs args, TypedEventHandler new SoftwareWpfRenderer(host), - RenderSurfaceType.OpenGL => new OpenGLWpfRenderer(host), + RenderSurfaceType.Software => new SoftwareWpfRenderer(host, isFlyoutSurface), + RenderSurfaceType.OpenGL => new OpenGLWpfRenderer(host, isFlyoutSurface), _ => throw new InvalidOperationException($"Render Surface type {host.RenderSurfaceType} is not supported") }; diff --git a/src/Uno.UI.Runtime.Skia.Wpf/Themes/Generic.xaml b/src/Uno.UI.Runtime.Skia.Wpf/Themes/Generic.xaml index 65a4b0a5536c..5a4710c6018f 100644 --- a/src/Uno.UI.Runtime.Skia.Wpf/Themes/Generic.xaml +++ b/src/Uno.UI.Runtime.Skia.Wpf/Themes/Generic.xaml @@ -18,6 +18,35 @@ + +