Bladeren bron

Set initial input focus using LinuxFrameBufferPlatform

Peter Davis 4 jaren geleden
bovenliggende
commit
1abf9964e6
1 gewijzigde bestanden met toevoegingen van 6 en 1 verwijderingen
  1. 6 1
      src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs

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