Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Avalonia.Base/Input/PenDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private bool PenDown(Pointer pointer, ulong timestamp,

if (source != null)
{
pointer.Capture(source);
pointer.Capture(source, CaptureSource.Implicit);
var settings = (source as Interactive)?.GetPlatformSettings();
if (settings is not null)
{
Expand Down Expand Up @@ -173,7 +173,7 @@ private bool PenUp(Pointer pointer, ulong timestamp,
}
finally
{
pointer.Capture(null);
pointer.Capture(null, CaptureSource.Implicit);
pointer.CaptureGestureRecognizer(null);
pointer.IsGestureRecognitionSkipped = false;
_lastMouseDownButton = default;
Expand Down
5 changes: 1 addition & 4 deletions src/Avalonia.Base/Input/Pointer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,7 @@ private void OnCaptureDetached(object? sender, VisualTreeAttachmentEventArgs e)

public void Dispose()
{
if (Captured != null)
{
Capture(null);
}
// callers are responsible for calling Capture(null, source) with an appropriate source
}

/// <summary>
Expand Down
5 changes: 3 additions & 2 deletions src/Avalonia.Base/Input/TouchDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void ProcessRawEvent(RawInputEventArgs ev)

_pointers[args.RawPointerId] = pointer = new Pointer(Pointer.GetNextFreeId(),
PointerType.Touch, _pointers.Count == 0);
pointer.Capture(hit);
pointer.Capture(hit, CaptureSource.Implicit);
}

var target = pointer.Captured ?? args.InputHitTestResult.firstEnabledAncestor ?? args.Root.RootElement;
Expand Down Expand Up @@ -109,6 +109,7 @@ public void ProcessRawEvent(RawInputEventArgs ev)
{
target.RaiseEvent(e);
}
pointer?.Capture(null, CaptureSource.Implicit);
}
}

Expand All @@ -117,7 +118,7 @@ public void ProcessRawEvent(RawInputEventArgs ev)
_pointers.Remove(args.RawPointerId);
using (pointer)
{
pointer?.Capture(null);
pointer?.Capture(null, CaptureSource.Platform);
pointer?.CaptureGestureRecognizer(null);
if (pointer != null)
pointer.IsGestureRecognitionSkipped = false;
Expand Down
Loading