Explorar o código

Merge pull request #5457 from petedavis/linux-fb-focus

Set initial input focus using LinuxFrameBufferPlatform
Steven Kirk %!s(int64=4) %!d(string=hai) anos
pai
achega
cae9badc1c

+ 6 - 1
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;