From 453e0abce17ea05d68eee43d87657d2ddd497ce7 Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Wed, 15 Jan 2025 13:22:05 +0100 Subject: [PATCH] chore: Ensure sequence of injected input is valid --- src/Uno.UWP/UI/Input/Preview.Injection/InjectedInputState.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Uno.UWP/UI/Input/Preview.Injection/InjectedInputState.cs b/src/Uno.UWP/UI/Input/Preview.Injection/InjectedInputState.cs index ab32bafaba52..9e6463958fef 100644 --- a/src/Uno.UWP/UI/Input/Preview.Injection/InjectedInputState.cs +++ b/src/Uno.UWP/UI/Input/Preview.Injection/InjectedInputState.cs @@ -11,6 +11,8 @@ namespace Windows.UI.Input.Preview.Injection; internal class InjectedInputState { + private static long _initialTimestamp = Stopwatch.GetTimestamp(); + public InjectedInputState(PointerDeviceType type) { Type = type; @@ -31,7 +33,7 @@ public InjectedInputState(PointerDeviceType type) public void StartNewSequence() { - Timestamp = (ulong)Stopwatch.GetElapsedTime(Stopwatch.GetTimestamp()).TotalMicroseconds; + Timestamp = (ulong)Stopwatch.GetElapsedTime(_initialTimestamp).TotalMicroseconds; FrameId = (uint)(Timestamp / 1000); }