From e236d42e66466b1ecdf520dcae2c9a8f80476242 Mon Sep 17 00:00:00 2001 From: Jumar Macato <16554748+jmacato@users.noreply.github.com> Date: Mon, 10 Jun 2024 23:14:03 +0800 Subject: [PATCH] Need to provide the socket.embed's returned registry path to the root accessible's Parent prop. --- src/Avalonia.FreeDesktop/AtSpi/AtSpiContext.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Avalonia.FreeDesktop/AtSpi/AtSpiContext.cs b/src/Avalonia.FreeDesktop/AtSpi/AtSpiContext.cs index a3f0f6532c..2b7c433a30 100644 --- a/src/Avalonia.FreeDesktop/AtSpi/AtSpiContext.cs +++ b/src/Avalonia.FreeDesktop/AtSpi/AtSpiContext.cs @@ -177,6 +177,11 @@ internal class AtSpiContext { public override Connection Connection { get; } + public RootAccessible() + { + + } + protected override async ValueTask<(string, ObjectPath)> OnGetChildAtIndexAsync(int index) { return default; @@ -189,7 +194,7 @@ internal class AtSpiContext protected override async ValueTask OnGetIndexInParentAsync() { - return default; + return -1; } protected override async ValueTask<(uint, (string, ObjectPath)[])[]> OnGetRelationSetAsync() @@ -199,7 +204,7 @@ internal class AtSpiContext protected override async ValueTask OnGetRoleAsync() { - return default; + return (uint)AtspiRole.ATSPI_ROLE_APPLICATION; } protected override async ValueTask OnGetRoleNameAsync() @@ -278,6 +283,9 @@ internal class AtSpiContext if (res is { } && res.Item1.StartsWith(":1.") && res.Item2.ToString() == RootPath) { + ac0.Parent = res; + ac0.Name = Application.Current?.Name ?? "Avalonia Application"; + //ac0.ChildCount = 0; } } @@ -304,7 +312,6 @@ internal class AtSpiContext await a11YConnection.ConnectAsync(); - cache = new RootCache(); var cachePathHandler = new PathHandler("/org/a11y/atspi/cache"); @@ -316,7 +323,6 @@ internal class AtSpiContext serviceName = a11YConnection.UniqueName; Instance = new AtSpiContext(a11YConnection); - s_instanced = true; } }