Refactor desktop window management and tray

This commit is contained in:
problematicconsumer
2023-12-28 23:16:56 +03:30
parent 4345b97d72
commit a3a893d7aa
17 changed files with 334 additions and 253 deletions

View File

@@ -28,7 +28,8 @@ bool FlutterWindow::OnCreate() {
SetChildContent(flutter_controller_->view()->GetNativeWindow());
flutter_controller_->engine()->SetNextFrameCallback([&]() {
this->Show();
// this->Show(); window_manager hidden at launch
""
});
// Flutter can complete the first frame before the "show window" callback is

View File

@@ -135,7 +135,9 @@ bool Win32Window::Create(const std::wstring& title,
double scale_factor = dpi / 96.0;
HWND window = CreateWindow(
window_class, title.c_str(), WS_OVERLAPPEDWINDOW,
// window_class, title.c_str(), WS_OVERLAPPEDWINDOW, // window_manager hidden at launch
window_class, title.c_str(),
WS_OVERLAPPEDWINDOW, // do not add WS_VISIBLE since the window will be shown later
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);