Browse Source
move Capture(null) from Pointer.Dispose() to callsites (#21363)
Co-authored-by: Jan Kučera <miloush@users.noreply.github.com>
release/11.3.16
Jan Kučera
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
6 additions and
8 deletions
-
src/Avalonia.Base/Input/PenDevice.cs
-
src/Avalonia.Base/Input/Pointer.cs
-
src/Avalonia.Base/Input/TouchDevice.cs
|
|
|
@ -104,7 +104,7 @@ namespace Avalonia.Input |
|
|
|
|
|
|
|
if (source != null) |
|
|
|
{ |
|
|
|
pointer.Capture(source); |
|
|
|
pointer.Capture(source, CaptureSource.Implicit); |
|
|
|
var settings = ((IInputRoot?)(source as Interactive)?.GetVisualRoot())?.PlatformSettings; |
|
|
|
if (settings is not null) |
|
|
|
{ |
|
|
|
@ -173,7 +173,7 @@ namespace Avalonia.Input |
|
|
|
} |
|
|
|
finally |
|
|
|
{ |
|
|
|
pointer.Capture(null); |
|
|
|
pointer.Capture(null, CaptureSource.Implicit); |
|
|
|
pointer.CaptureGestureRecognizer(null); |
|
|
|
pointer.IsGestureRecognitionSkipped = false; |
|
|
|
_lastMouseDownButton = default; |
|
|
|
|
|
|
|
@ -136,10 +136,7 @@ namespace Avalonia.Input |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
{ |
|
|
|
if (Captured != null) |
|
|
|
{ |
|
|
|
Capture(null); |
|
|
|
} |
|
|
|
// callers are responsible for calling Capture(null, source) with an appropriate source
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
@ -48,7 +48,7 @@ namespace Avalonia.Input |
|
|
|
|
|
|
|
_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; |
|
|
|
@ -109,6 +109,7 @@ namespace Avalonia.Input |
|
|
|
{ |
|
|
|
target.RaiseEvent(e); |
|
|
|
} |
|
|
|
pointer?.Capture(null, CaptureSource.Implicit); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -117,7 +118,7 @@ namespace Avalonia.Input |
|
|
|
_pointers.Remove(args.RawPointerId); |
|
|
|
using (pointer) |
|
|
|
{ |
|
|
|
pointer?.Capture(null); |
|
|
|
pointer?.Capture(null, CaptureSource.Platform); |
|
|
|
pointer?.CaptureGestureRecognizer(null); |
|
|
|
if (pointer != null) |
|
|
|
pointer.IsGestureRecognitionSkipped = false; |
|
|
|
|