Browse Source

Ignore mouse move when left window (#13724)

pull/13780/head
Lubomir Tetak 3 years ago
committed by GitHub
parent
commit
4a689cb577
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      src/Avalonia.Base/Input/PointerOverPreProcessor.cs

16
src/Avalonia.Base/Input/PointerOverPreProcessor.cs

@ -41,14 +41,16 @@ namespace Avalonia.Input
_lastActivePointerDevice = pointerDevice; _lastActivePointerDevice = pointerDevice;
} }
if (args.Type is RawPointerEventType.LeaveWindow or RawPointerEventType.NonClientLeftButtonDown if (args.Type is RawPointerEventType.LeaveWindow or RawPointerEventType.NonClientLeftButtonDown
or RawPointerEventType.TouchCancel or RawPointerEventType.TouchEnd or RawPointerEventType.TouchCancel or RawPointerEventType.TouchEnd)
&& _currentPointer is var (lastPointer, lastPosition))
{ {
_currentPointer = null; if (_currentPointer is var (lastPointer, lastPosition))
ClearPointerOver(lastPointer, args.Root, 0, PointToClient(args.Root, lastPosition), {
new PointerPointProperties(args.InputModifiers, args.Type.ToUpdateKind()), _currentPointer = null;
args.InputModifiers.ToKeyModifiers()); ClearPointerOver(lastPointer, args.Root, 0, PointToClient(args.Root, lastPosition),
new PointerPointProperties(args.InputModifiers, args.Type.ToUpdateKind()),
args.InputModifiers.ToKeyModifiers());
}
} }
else if (args.Type is RawPointerEventType.TouchBegin or RawPointerEventType.TouchUpdate && args.Root is Visual visual) else if (args.Type is RawPointerEventType.TouchBegin or RawPointerEventType.TouchUpdate && args.Root is Visual visual)
{ {

Loading…
Cancel
Save