Black screen flashing (and poor startup performance)
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
I just noticed that startup time went down the hill a lot since the v3.4.0.
And now, since there's a lot of sync work being done before the app draws the UI, the window is black for a while:
Dev branch / v3.4.0
https://github.com/KRTirtho/spotube/assets/3144291/1cbe2f44-0c0a-4297-8e1d-e4a4d88f42bc
v3.3.0
https://github.com/KRTirtho/spotube/assets/3144291/8a579313-0594-4cfd-ab87-7c36beba81a2
Expected Behavior
One way to "fix" the black screen, we could move the DesktopTools.ensureInitialized call further down, just before the rendering. This will make sure that the window is hidden before all content is ready (see https://github.com/KRTirtho/spotube/pull/1003).
await DesktopTools.ensureInitialized(
DesktopWindowOptions(
hideTitleBar: true,
title: "Spotube",
backgroundColor: Colors.transparent,
minimumSize: const Size(300, 700),
),
);
Catcher2(
enableLogger: arguments["verbose"],
debugConfig: Catcher2Options(
SilentReportMode(),
[
ConsoleHandler(
enableDeviceParameters: false,
enableApplicationParameters: false,
),
if (!kIsWeb) FileHandler(await getLogsPath(), printLogs: false),
],
),
// ... rest of the code
Steps to reproduce
However, it would be nice to find the culprit and maybe optimize it? Not sure what change made such an impact
Operating System
macOS
Spotube version
dev
Installation source
GitHub Releases (Binary)
Additional information
No response