Skip to content

Commit

Permalink
Merge pull request #18279 from unoplatform/mergify/bp/release/stable/…
Browse files Browse the repository at this point in the history
…5.4/pr-18276

fix(fb): Ensure that FB has a Window to render to (backport #18276)
  • Loading branch information
jeromelaban authored Sep 24, 2024
2 parents 4f271b9 + 92fb91a commit 80e1471
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 80e1471

Please sign in to comment.