Skip to content

Commit

Permalink
fix: Adjust framebuffer host initialization sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Dec 2, 2021
1 parent f8ce298 commit 7a8ffef
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions src/Uno.UI.Runtime.Skia.Linux.FrameBuffer/FramebufferHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,21 @@ private void Initialize()
ApiExtensibility.Register(typeof(Windows.UI.ViewManagement.IApplicationViewExtension), o => new ApplicationViewExtension(o));
ApiExtensibility.Register(typeof(Windows.Graphics.Display.IDisplayInformationExtension), o => _displayInformationExtension ??= new DisplayInformationExtension(o));

_renderer = new Renderer();
_displayInformationExtension!.Renderer = _renderer;

bool EnqueueNative(DispatcherQueuePriority priority, DispatcherQueueHandler callback)
{
_eventLoop.Schedule(() => callback());

return true;
}

void Dispatch(System.Action d)
{
_eventLoop.Schedule(() => d());
}

Windows.UI.Core.CoreDispatcher.DispatchOverride = Dispatch;
Windows.UI.Core.CoreDispatcher.HasThreadAccessOverride = () => _isDispatcherThread;
=> _eventLoop.Schedule(() => d());

void CreateApp(ApplicationInitializationCallbackParams _)
{
var app = _appBuilder();
app.Host = this;
}

Windows.UI.Core.CoreDispatcher.DispatchOverride = Dispatch;
Windows.UI.Core.CoreDispatcher.HasThreadAccessOverride = () => _isDispatcherThread;

_renderer = new Renderer();
_displayInformationExtension!.Renderer = _renderer;

WUX.Application.Start(CreateApp, _args);
}
}
Expand Down

0 comments on commit 7a8ffef

Please sign in to comment.