Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor multi-window support #1

Merged
merged 3 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ci/licenses_golden/excluded_files
Original file line number Diff line number Diff line change
Expand Up @@ -335,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 @@ -400,7 +401,6 @@
../../../flutter/shell/platform/windows/client_wrapper/flutter_engine_unittests.cc
../../../flutter/shell/platform/windows/client_wrapper/flutter_view_controller_unittests.cc
../../../flutter/shell/platform/windows/client_wrapper/flutter_view_unittests.cc
../../../flutter/shell/platform/windows/client_wrapper/flutter_window_controller_unittests.cc
../../../flutter/shell/platform/windows/client_wrapper/plugin_registrar_windows_unittests.cc
../../../flutter/shell/platform/windows/client_wrapper/testing
../../../flutter/shell/platform/windows/compositor_opengl_unittests.cc
Expand All @@ -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
17 changes: 8 additions & 9 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -44480,7 +44480,6 @@ ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/st
ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/standard_message_codec.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/standard_method_codec.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/texture_registrar.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/windowing.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/plugin_registrar.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/standard_codec.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/texture_registrar_impl.h + ../../../flutter/LICENSE
Expand Down Expand Up @@ -47426,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 @@ -47456,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 @@ -48158,18 +48158,11 @@ FILE: ../../../flutter/shell/platform/windows/accessibility_plugin.cc
FILE: ../../../flutter/shell/platform/windows/accessibility_plugin.h
FILE: ../../../flutter/shell/platform/windows/client_wrapper/flutter_engine.cc
FILE: ../../../flutter/shell/platform/windows/client_wrapper/flutter_view_controller.cc
FILE: ../../../flutter/shell/platform/windows/client_wrapper/flutter_win32_window.cc
FILE: ../../../flutter/shell/platform/windows/client_wrapper/flutter_window_controller.cc
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/dart_project.h
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/flutter_engine.h
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/flutter_view.h
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/flutter_view_controller.h
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/flutter_win32_window.h
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/flutter_window_controller.h
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/plugin_registrar_windows.h
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/win32_window.h
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/win32_wrapper.h
FILE: ../../../flutter/shell/platform/windows/client_wrapper/win32_window.cc
FILE: ../../../flutter/shell/platform/windows/compositor.h
FILE: ../../../flutter/shell/platform/windows/compositor_opengl.cc
FILE: ../../../flutter/shell/platform/windows/compositor_opengl.h
Expand Down Expand Up @@ -48206,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 @@ -48255,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;
mattkae marked this conversation as resolved.
Show resolved Hide resolved
}
}
#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
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 Down
Loading