Browse Source

Merge pull request #10064 from AvaloniaUI/dont-process-events-when-toplevel-is-disposed

Don't process events when TopLevel is disposed.
pull/10071/head
Max Katz 4 years ago
committed by GitHub
parent
commit
0288a7a974
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      src/Avalonia.Controls/TopLevel.cs

17
src/Avalonia.Controls/TopLevel.cs

@ -581,12 +581,21 @@ namespace Avalonia.Controls
/// <param name="e">The event args.</param>
private void HandleInput(RawInputEventArgs e)
{
if (e is RawPointerEventArgs pointerArgs)
if (PlatformImpl != null)
{
pointerArgs.InputHitTestResult = this.InputHitTest(pointerArgs.Position);
}
if (e is RawPointerEventArgs pointerArgs)
{
pointerArgs.InputHitTestResult = this.InputHitTest(pointerArgs.Position);
}
_inputManager?.ProcessInput(e);
_inputManager?.ProcessInput(e);
}
else
{
Logger.TryGet(LogEventLevel.Warning, LogArea.Control)?.Log(
this,
"PlatformImpl is null, couldn't handle input.");
}
}
private void SceneInvalidated(object? sender, SceneInvalidatedEventArgs e)

Loading…
Cancel
Save