Skip to content

Commit

Permalink
Ignore mouse move when left window (#13724)
Browse files Browse the repository at this point in the history
#Conflicts:
#	src/Avalonia.Base/Input/PointerOverPreProcessor.cs
  • Loading branch information
ltetak authored and maxkatz6 committed Dec 5, 2023
1 parent 579cd24 commit cd18ff3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Avalonia.Base/Input/PointerOverPreProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@ public void OnNext(RawInputEventArgs value)
}

if (args.Type is RawPointerEventType.LeaveWindow or RawPointerEventType.NonClientLeftButtonDown
&& _currentPointer is var (lastPointer, lastPosition))
or RawPointerEventType.TouchCancel or RawPointerEventType.TouchEnd)
{
_currentPointer = null;
ClearPointerOver(lastPointer, args.Root, 0, PointToClient(args.Root, lastPosition),
new PointerPointProperties(args.InputModifiers, args.Type.ToUpdateKind()),
args.InputModifiers.ToKeyModifiers());
if (_currentPointer is var (lastPointer, lastPosition))
{
_currentPointer = null;
ClearPointerOver(lastPointer, args.Root, 0, PointToClient(args.Root, lastPosition),
new PointerPointProperties(args.InputModifiers, args.Type.ToUpdateKind()),
args.InputModifiers.ToKeyModifiers());
}
}
else if (pointerDevice.TryGetPointer(args) is { } pointer
&& pointer.Type != PointerType.Touch)
Expand Down

0 comments on commit cd18ff3

Please sign in to comment.