Skip to content

Commit

Permalink
Fix interface copying so that it works
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkezone committed Apr 11, 2021
1 parent fb20411 commit 9327ec1
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions shell/platform/windows/flutter_windows_winuwp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,26 @@ FlutterDesktopViewControllerCreateFromCoreWindow(
std::unique_ptr<flutter::FlutterWindowsEngine>(EngineFromHandle(engine)));
state->view->CreateRenderSurface();

winrt::Windows::ApplicationModel::Activation::LaunchActivatedEventArgs
winrt::Windows::ApplicationModel::Activation::IActivatedEventArgs
arg_interface{nullptr};
winrt::copy_from_abi(arg_interface, args);

std::vector<std::string> engine_switches;

if (arg_interface != nullptr) {
std::string launchargs = winrt::to_string(arg_interface.Arguments());
if (!launchargs.empty()) {
engine_switches = split(launchargs);
}
winrt::Windows::ApplicationModel::Activation::LaunchActivatedEventArgs launch{
nullptr};
switch (arg_interface.Kind()) {
case winrt::Windows::ApplicationModel::Activation::ActivationKind::Launch:
launch = arg_interface.as<winrt::Windows::ApplicationModel::Activation::
LaunchActivatedEventArgs>();
if (launch != nullptr) {
std::string launchargs = winrt::to_string(launch.Arguments());
if (!launchargs.empty()) {
engine_switches = split(launchargs);
}
}
break;
default:
break;
}

state->view->GetEngine()->SetSwitches(engine_switches);
Expand Down

0 comments on commit 9327ec1

Please sign in to comment.