Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

chore: fix flicking when start up on windows platform

Predidit4be54e157b62
diff --git a/lib/main.dart b/lib/main.dart
index 54221f54..a1f273fb 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -68,6 +68,8 @@ void main() async {
title: 'Kazumi',
);
windowManager.waitUntilReadyToShow(windowOptions, () async {
+ // Native window show has been blocked in `flutter_windows.cppL36` to avoid flickering.
+ // Without this. the window will never show on Windows.
await windowManager.show();
await windowManager.focus();
});
diff --git a/windows/runner/flutter_window.cpp b/windows/runner/flutter_window.cpp
index 7449ce8a..bcc23164 100644
--- a/windows/runner/flutter_window.cpp
+++ b/windows/runner/flutter_window.cpp
@@ -33,9 +33,11 @@ bool FlutterWindow::OnCreate() {
RegisterPlugins(flutter_controller_->engine());
SetChildContent(flutter_controller_->view()->GetNativeWindow());
- flutter_controller_->engine()->SetNextFrameCallback([&]() {
- this->Show();
- });
+ // Removed automatic window show to let window_manager plugin control visibility
+ // This prevents window flashing during startup
+ // flutter_controller_->engine()->SetNextFrameCallback([&]() {
+ // this->Show();
+ // });
// Flutter can complete the first frame before the "show window" callback is
// registered. The following call ensures a frame is pending to ensure the