From 02789d2d48e442997d70a5eba024d02094fcb554 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 27 Jul 2023 00:19:37 +0200 Subject: [PATCH] Revert "Allow embedded root automation peers." This reverts commit 0e7b8f6f4589195ae35e933c64f89f9478832fb1. The code is in the wrong place. --- .../Avalonia.Win32/Automation/RootAutomationNode.cs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/Windows/Avalonia.Win32/Automation/RootAutomationNode.cs b/src/Windows/Avalonia.Win32/Automation/RootAutomationNode.cs index 0a73c8bc7b..739f0ac251 100644 --- a/src/Windows/Avalonia.Win32/Automation/RootAutomationNode.cs +++ b/src/Windows/Avalonia.Win32/Automation/RootAutomationNode.cs @@ -33,7 +33,7 @@ namespace Avalonia.Win32.Automation return null; var p = WindowImpl.PointToClient(new PixelPoint((int)x, (int)y)); - var found = InvokeSync(() => GetPeerFromPoint(p)); + var found = InvokeSync(() => Peer.GetPeerFromPoint(p)); var result = GetOrCreate(found) as IRawElementProviderFragment; return result; } @@ -101,15 +101,5 @@ namespace Avalonia.Win32.Automation return result; } } - - private AutomationPeer? GetPeerFromPoint(Point p) - { - var hit = Peer.GetPeerFromPoint(p); - - while (hit != Peer && hit?.GetProvider() is { } embeddedRoot) - hit = embeddedRoot.GetPeerFromPoint(p); - - return hit; - } } }