From 1abf9964e6f6cdd52be1e6f24da50f84559ab8c2 Mon Sep 17 00:00:00 2001 From: Peter Davis Date: Wed, 10 Feb 2021 11:13:41 +1030 Subject: [PATCH] Set initial input focus using LinuxFrameBufferPlatform --- .../Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs b/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs index 340d10517d..3c8d3b5e06 100644 --- a/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs +++ b/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Threading; using Avalonia.Controls; @@ -79,6 +79,11 @@ namespace Avalonia.LinuxFramebuffer tl.Prepare(); _topLevel = tl; _topLevel.Renderer.Start(); + + if (_topLevel is IFocusScope scope) + { + FocusManager.Instance?.SetFocusScope(scope); + } } _topLevel.Content = value;