From 6de63c3f6376ff88da4a20120cfef0d0e7fa7e94 Mon Sep 17 00:00:00 2001 From: Levi Date: Fri, 6 Feb 2026 22:38:31 +0800 Subject: [PATCH] fix: low FPS on Windows (#1279) --- ui/flutter/windows/runner/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/flutter/windows/runner/main.cpp b/ui/flutter/windows/runner/main.cpp index 657a0070..2a5ee88a 100644 --- a/ui/flutter/windows/runner/main.cpp +++ b/ui/flutter/windows/runner/main.cpp @@ -65,6 +65,11 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, flutter::DartProject project(L"data"); + // TODO: Remove this. + // This forces Flutter to use a separate thread for Dart. + // This mode will be removed in a future version of Flutter. + project.set_ui_thread_policy(flutter::UIThreadPolicy::RunOnSeparateThread); + std::vector command_line_arguments = GetCommandLineArguments();