opt: win32 api (#2246)

* tweaks

* opt: win32 api
This commit is contained in:
My-Responsitories
2026-05-31 03:03:15 +00:00
committed by GitHub
parent d4d9fc3405
commit b3e2dcf2c5
7 changed files with 18 additions and 45 deletions

View File

@@ -4,9 +4,6 @@
#include "flutter/generated_plugin_registrant.h"
#include <flutter/method_channel.h>
#include <flutter/standard_method_codec.h>
FlutterWindow::FlutterWindow(const flutter::DartProject& project)
: project_(project) {}
@@ -29,24 +26,6 @@ bool FlutterWindow::OnCreate() {
}
RegisterPlugins(flutter_controller_->engine());
// flutter_inappwebview
// 6.2.0-beta.2+ https://github.com/pichillilorenzo/flutter_inappwebview/issues/2482
// 6.1.5 https://github.com/pichillilorenzo/flutter_inappwebview/issues/2512#issuecomment-3031039587
flutter::MethodChannel<> channel(
flutter_controller_->engine()->messenger(), "window_control",
&flutter::StandardMethodCodec::GetInstance());
channel.SetMethodCallHandler(
[](const flutter::MethodCall<>& call,
std::unique_ptr<flutter::MethodResult<>> result) {
if (call.method_name().compare("closeWindow") == 0) {
HANDLE hProcess = GetCurrentProcess();
TerminateProcess(hProcess, 0);
result->Success();
} else {
result->NotImplemented();
}
});
SetChildContent(flutter_controller_->view()->GetNativeWindow());
// flutter_controller_->engine()->SetNextFrameCallback([&]() {