Skip to content

Commit

Permalink
fix(fb): Ensure that FB has a Window to render to
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Sep 24, 2024
1 parent 3d467c8 commit 57a5b19
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/Uno.UI.Runtime.Skia.Linux.FrameBuffer/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ void Invalidate()
{
_host.RootElement.XamlRoot!.Compositor.RenderRootVisual(surface, rootVisual, null);
}
else
{
if (this.Log().IsEnabled(LogLevel.Debug))
{
this.Log().Debug($"Unable to render frame, _host.RootElement?.Visual is null");
}
}

_fbDev.VSync();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ public FrameBufferWindowWrapper()

public override object? NativeWindow => null;

internal Window? Window { get; private set; }

internal void RaiseNativeSizeChanged(Size newWindowSize)
{
Bounds = new Rect(default, newWindowSize);
VisibleBounds = new Rect(default, newWindowSize);
Size = new((int)newWindowSize.Width, (int)newWindowSize.Height);
}

internal void OnNativeVisibilityChanged(bool visible) => IsVisible = visible;
Expand Down
4 changes: 3 additions & 1 deletion src/Uno.UI/UI/Xaml/Window/Native/NativeWindowWrapperBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ protected NativeWindowWrapperBase()

public ContentSiteView ContentSiteView => _contentSite.View;

protected XamlRoot? XamlRoot => _xamlRoot;
internal protected XamlRoot? XamlRoot => _xamlRoot;

internal protected Window? Window => _window;

internal void SetWindow(Window window, XamlRoot xamlRoot)
{
Expand Down

0 comments on commit 57a5b19

Please sign in to comment.