From 43cebd0c0481a4d77725f82a12d3f729330ddefd Mon Sep 17 00:00:00 2001 From: Noo6 <72285529+No06@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:23:20 +0800 Subject: [PATCH] fix: window blink on startup (#447) --- lib/main.dart | 2 +- windows/runner/win32_window.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 8cc5d0639..8f06bceaf 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -70,7 +70,7 @@ Future _initApp() async { final windowSize = Stores.setting.windowSize; final hideTitleBar = Stores.setting.hideTitleBar.fetch(); - SystemUIs.initDesktopWindow( + await SystemUIs.initDesktopWindow( hideTitleBar: hideTitleBar, size: windowSize.fetch().toSize(), listener: WindowSizeListener(windowSize), diff --git a/windows/runner/win32_window.cpp b/windows/runner/win32_window.cpp index c10f08dc7..3273c2c08 100644 --- a/windows/runner/win32_window.cpp +++ b/windows/runner/win32_window.cpp @@ -117,7 +117,7 @@ bool Win32Window::CreateAndShow(const std::wstring& title, double scale_factor = dpi / 96.0; HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), Scale(size.width, scale_factor), Scale(size.height, scale_factor), nullptr, nullptr, GetModuleHandle(nullptr), this);