Skip to content

Commit

Permalink
chore: Ensure sequence of injected input is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Jan 15, 2025
1 parent e597ec3 commit 453e0ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Uno.UWP/UI/Input/Preview.Injection/InjectedInputState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

Expand Down

0 comments on commit 453e0ab

Please sign in to comment.