Skip to content

Commit

Permalink
Refactor multi-window support
Browse files Browse the repository at this point in the history
  • Loading branch information
hbatagelo committed Dec 17, 2024
1 parent f543082 commit 94e10b2
Show file tree
Hide file tree
Showing 41 changed files with 2,901 additions and 2,650 deletions.
4 changes: 3 additions & 1 deletion ci/licenses_golden/excluded_files
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@
../../../flutter/shell/platform/common/client_wrapper/standard_method_codec_unittests.cc
../../../flutter/shell/platform/common/client_wrapper/testing
../../../flutter/shell/platform/common/client_wrapper/texture_registrar_unittests.cc
../../../flutter/shell/platform/common/client_wrapper/windowing_unittests.cc
../../../flutter/shell/platform/common/engine_switches_unittests.cc
../../../flutter/shell/platform/common/flutter_platform_node_delegate_unittests.cc
../../../flutter/shell/platform/common/geometry_unittests.cc
Expand All @@ -336,6 +335,7 @@
../../../flutter/shell/platform/common/text_editing_delta_unittests.cc
../../../flutter/shell/platform/common/text_input_model_unittests.cc
../../../flutter/shell/platform/common/text_range_unittests.cc
../../../flutter/shell/platform/common/windowing_unittests.cc
../../../flutter/shell/platform/darwin/Doxyfile
../../../flutter/shell/platform/darwin/common/availability_version_check_unittests.cc
../../../flutter/shell/platform/darwin/common/framework/Source/flutter_codecs_unittest.mm
Expand Down Expand Up @@ -409,6 +409,7 @@
../../../flutter/shell/platform/windows/direct_manipulation_unittests.cc
../../../flutter/shell/platform/windows/dpi_utils_unittests.cc
../../../flutter/shell/platform/windows/fixtures
../../../flutter/shell/platform/windows/flutter_host_window_controller_unittests.cc
../../../flutter/shell/platform/windows/flutter_project_bundle_unittests.cc
../../../flutter/shell/platform/windows/flutter_window_unittests.cc
../../../flutter/shell/platform/windows/flutter_windows_engine_unittests.cc
Expand All @@ -427,6 +428,7 @@
../../../flutter/shell/platform/windows/task_runner_unittests.cc
../../../flutter/shell/platform/windows/testing
../../../flutter/shell/platform/windows/text_input_plugin_unittest.cc
../../../flutter/shell/platform/windows/windowing_handler_unittests.cc
../../../flutter/shell/platform/windows/window_proc_delegate_manager_unittests.cc
../../../flutter/shell/platform/windows/window_unittests.cc
../../../flutter/shell/platform/windows/windows_lifecycle_manager_unittests.cc
Expand Down
9 changes: 8 additions & 1 deletion ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -47425,7 +47425,6 @@ FILE: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/stan
FILE: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/standard_message_codec.h
FILE: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/standard_method_codec.h
FILE: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/texture_registrar.h
FILE: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/windowing.h
FILE: ../../../flutter/shell/platform/common/client_wrapper/plugin_registrar.cc
FILE: ../../../flutter/shell/platform/common/client_wrapper/standard_codec.cc
FILE: ../../../flutter/shell/platform/common/client_wrapper/texture_registrar_impl.h
Expand Down Expand Up @@ -47455,6 +47454,8 @@ FILE: ../../../flutter/shell/platform/common/text_editing_delta.h
FILE: ../../../flutter/shell/platform/common/text_input_model.cc
FILE: ../../../flutter/shell/platform/common/text_input_model.h
FILE: ../../../flutter/shell/platform/common/text_range.h
FILE: ../../../flutter/shell/platform/common/windowing.cc
FILE: ../../../flutter/shell/platform/common/windowing.h
FILE: ../../../flutter/shell/platform/darwin/common/availability_version_check.cc
FILE: ../../../flutter/shell/platform/darwin/common/availability_version_check.h
FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.h
Expand Down Expand Up @@ -48198,6 +48199,10 @@ FILE: ../../../flutter/shell/platform/windows/flutter_platform_node_delegate_win
FILE: ../../../flutter/shell/platform/windows/flutter_platform_node_delegate_windows.h
FILE: ../../../flutter/shell/platform/windows/flutter_project_bundle.cc
FILE: ../../../flutter/shell/platform/windows/flutter_project_bundle.h
FILE: ../../../flutter/shell/platform/windows/flutter_host_window.cc
FILE: ../../../flutter/shell/platform/windows/flutter_host_window.h
FILE: ../../../flutter/shell/platform/windows/flutter_host_window_controller.cc
FILE: ../../../flutter/shell/platform/windows/flutter_host_window_controller.h
FILE: ../../../flutter/shell/platform/windows/flutter_window.cc
FILE: ../../../flutter/shell/platform/windows/flutter_window.h
FILE: ../../../flutter/shell/platform/windows/flutter_windows.cc
Expand Down Expand Up @@ -48247,6 +48252,8 @@ FILE: ../../../flutter/shell/platform/windows/window_binding_handler_delegate.h
FILE: ../../../flutter/shell/platform/windows/window_proc_delegate_manager.cc
FILE: ../../../flutter/shell/platform/windows/window_proc_delegate_manager.h
FILE: ../../../flutter/shell/platform/windows/window_state.h
FILE: ../../../flutter/shell/platform/windows/windowing_handler.cc
FILE: ../../../flutter/shell/platform/windows/windowing_handler.h
FILE: ../../../flutter/shell/platform/windows/windows_lifecycle_manager.cc
FILE: ../../../flutter/shell/platform/windows/windows_lifecycle_manager.h
FILE: ../../../flutter/shell/platform/windows/windows_proc_table.cc
Expand Down
4 changes: 4 additions & 0 deletions common/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,10 @@ struct Settings {
// If true, the UI thread is the platform thread on supported
// platforms.
bool merged_platform_ui_thread = true;

// Enable support for multiple windows. Ignored if not supported on the
// platform.
bool enable_multi_window = false;
};

} // namespace flutter
Expand Down
11 changes: 11 additions & 0 deletions shell/common/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,17 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) {
settings.merged_platform_ui_thread = !command_line.HasOption(
FlagForSwitch(Switch::DisableMergedPlatformUIThread));

#if FML_OS_WIN
// Process the EnableMultiWindow switch on Windows.
{
std::string enable_multi_window_value;
if (command_line.GetOptionValue(FlagForSwitch(Switch::EnableMultiWindow),
&enable_multi_window_value)) {
settings.enable_multi_window = "true" == enable_multi_window_value;
}
}
#endif // FML_OS_WIN

return settings;
}

Expand Down
4 changes: 4 additions & 0 deletions shell/common/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ DEF_SWITCH(DisableMergedPlatformUIThread,
DEF_SWITCH(DisableAndroidSurfaceControl,
"disable-surface-control",
"Disable the SurfaceControl backed swapchain even when supported.")
DEF_SWITCH(EnableMultiWindow,
"enable-multi-window",
"Enable support for multiple windows. Ignored if not supported on "
"the platform.")
DEF_SWITCHES_END

void PrintUsage(const std::string& executable_name);
Expand Down
11 changes: 9 additions & 2 deletions shell/platform/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,13 @@ source_set("common_cpp_core") {
public = [
"geometry.h",
"path_utils.h",
"windowing.h",
]

sources = [ "path_utils.cc" ]
sources = [
"path_utils.cc",
"windowing.cc",
]

public_configs = [ "//flutter:config" ]
}
Expand All @@ -157,7 +161,10 @@ if (enable_unittests) {
executable("common_cpp_core_unittests") {
testonly = true

sources = [ "path_utils_unittests.cc" ]
sources = [
"path_utils_unittests.cc",
"windowing_unittests.cc",
]

deps = [
":common_cpp_core",
Expand Down
1 change: 0 additions & 1 deletion shell/platform/common/client_wrapper/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ executable("client_wrapper_unittests") {
"testing/test_codec_extensions.cc",
"testing/test_codec_extensions.h",
"texture_registrar_unittests.cc",
"windowing_unittests.cc",
]

deps = [
Expand Down
2 changes: 0 additions & 2 deletions shell/platform/common/client_wrapper/core_wrapper_files.gni
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ core_cpp_client_wrapper_includes =
"include/flutter/standard_message_codec.h",
"include/flutter/standard_method_codec.h",
"include/flutter/texture_registrar.h",
"include/flutter/windowing.h",
],
"abspath")

Expand All @@ -47,7 +46,6 @@ core_cpp_client_wrapper_sources = get_path_info([
"core_implementations.cc",
"plugin_registrar.cc",
"standard_codec.cc",
"windowing.cc",
],
"abspath")

Expand Down
Loading

0 comments on commit 94e10b2

Please sign in to comment.