Skip to content

Commit 69bdf97

Browse files
authored
Merge pull request #1 from canonical/refactor-multi-win-foundation
Refactor multi-window support
2 parents 175e88e + c27b446 commit 69bdf97

39 files changed

Lines changed: 3208 additions & 1639 deletions

ci/licenses_golden/excluded_files

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@
335335
../../../flutter/shell/platform/common/text_editing_delta_unittests.cc
336336
../../../flutter/shell/platform/common/text_input_model_unittests.cc
337337
../../../flutter/shell/platform/common/text_range_unittests.cc
338+
../../../flutter/shell/platform/common/windowing_unittests.cc
338339
../../../flutter/shell/platform/darwin/Doxyfile
339340
../../../flutter/shell/platform/darwin/common/availability_version_check_unittests.cc
340341
../../../flutter/shell/platform/darwin/common/framework/Source/flutter_codecs_unittest.mm
@@ -400,7 +401,6 @@
400401
../../../flutter/shell/platform/windows/client_wrapper/flutter_engine_unittests.cc
401402
../../../flutter/shell/platform/windows/client_wrapper/flutter_view_controller_unittests.cc
402403
../../../flutter/shell/platform/windows/client_wrapper/flutter_view_unittests.cc
403-
../../../flutter/shell/platform/windows/client_wrapper/flutter_window_controller_unittests.cc
404404
../../../flutter/shell/platform/windows/client_wrapper/plugin_registrar_windows_unittests.cc
405405
../../../flutter/shell/platform/windows/client_wrapper/testing
406406
../../../flutter/shell/platform/windows/compositor_opengl_unittests.cc
@@ -409,6 +409,7 @@
409409
../../../flutter/shell/platform/windows/direct_manipulation_unittests.cc
410410
../../../flutter/shell/platform/windows/dpi_utils_unittests.cc
411411
../../../flutter/shell/platform/windows/fixtures
412+
../../../flutter/shell/platform/windows/flutter_host_window_controller_unittests.cc
412413
../../../flutter/shell/platform/windows/flutter_project_bundle_unittests.cc
413414
../../../flutter/shell/platform/windows/flutter_window_unittests.cc
414415
../../../flutter/shell/platform/windows/flutter_windows_engine_unittests.cc
@@ -427,6 +428,7 @@
427428
../../../flutter/shell/platform/windows/task_runner_unittests.cc
428429
../../../flutter/shell/platform/windows/testing
429430
../../../flutter/shell/platform/windows/text_input_plugin_unittest.cc
431+
../../../flutter/shell/platform/windows/windowing_handler_unittests.cc
430432
../../../flutter/shell/platform/windows/window_proc_delegate_manager_unittests.cc
431433
../../../flutter/shell/platform/windows/window_unittests.cc
432434
../../../flutter/shell/platform/windows/windows_lifecycle_manager_unittests.cc

ci/licenses_golden/licenses_flutter

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44480,7 +44480,6 @@ ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/st
4448044480
ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/standard_message_codec.h + ../../../flutter/LICENSE
4448144481
ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/standard_method_codec.h + ../../../flutter/LICENSE
4448244482
ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/texture_registrar.h + ../../../flutter/LICENSE
44483-
ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/windowing.h + ../../../flutter/LICENSE
4448444483
ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/plugin_registrar.cc + ../../../flutter/LICENSE
4448544484
ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/standard_codec.cc + ../../../flutter/LICENSE
4448644485
ORIGIN: ../../../flutter/shell/platform/common/client_wrapper/texture_registrar_impl.h + ../../../flutter/LICENSE
@@ -47426,7 +47425,6 @@ FILE: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/stan
4742647425
FILE: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/standard_message_codec.h
4742747426
FILE: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/standard_method_codec.h
4742847427
FILE: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/texture_registrar.h
47429-
FILE: ../../../flutter/shell/platform/common/client_wrapper/include/flutter/windowing.h
4743047428
FILE: ../../../flutter/shell/platform/common/client_wrapper/plugin_registrar.cc
4743147429
FILE: ../../../flutter/shell/platform/common/client_wrapper/standard_codec.cc
4743247430
FILE: ../../../flutter/shell/platform/common/client_wrapper/texture_registrar_impl.h
@@ -47456,6 +47454,8 @@ FILE: ../../../flutter/shell/platform/common/text_editing_delta.h
4745647454
FILE: ../../../flutter/shell/platform/common/text_input_model.cc
4745747455
FILE: ../../../flutter/shell/platform/common/text_input_model.h
4745847456
FILE: ../../../flutter/shell/platform/common/text_range.h
47457+
FILE: ../../../flutter/shell/platform/common/windowing.cc
47458+
FILE: ../../../flutter/shell/platform/common/windowing.h
4745947459
FILE: ../../../flutter/shell/platform/darwin/common/availability_version_check.cc
4746047460
FILE: ../../../flutter/shell/platform/darwin/common/availability_version_check.h
4746147461
FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.h
@@ -48158,18 +48158,11 @@ FILE: ../../../flutter/shell/platform/windows/accessibility_plugin.cc
4815848158
FILE: ../../../flutter/shell/platform/windows/accessibility_plugin.h
4815948159
FILE: ../../../flutter/shell/platform/windows/client_wrapper/flutter_engine.cc
4816048160
FILE: ../../../flutter/shell/platform/windows/client_wrapper/flutter_view_controller.cc
48161-
FILE: ../../../flutter/shell/platform/windows/client_wrapper/flutter_win32_window.cc
48162-
FILE: ../../../flutter/shell/platform/windows/client_wrapper/flutter_window_controller.cc
4816348161
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/dart_project.h
4816448162
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/flutter_engine.h
4816548163
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/flutter_view.h
4816648164
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/flutter_view_controller.h
48167-
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/flutter_win32_window.h
48168-
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/flutter_window_controller.h
4816948165
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/plugin_registrar_windows.h
48170-
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/win32_window.h
48171-
FILE: ../../../flutter/shell/platform/windows/client_wrapper/include/flutter/win32_wrapper.h
48172-
FILE: ../../../flutter/shell/platform/windows/client_wrapper/win32_window.cc
4817348166
FILE: ../../../flutter/shell/platform/windows/compositor.h
4817448167
FILE: ../../../flutter/shell/platform/windows/compositor_opengl.cc
4817548168
FILE: ../../../flutter/shell/platform/windows/compositor_opengl.h
@@ -48206,6 +48199,10 @@ FILE: ../../../flutter/shell/platform/windows/flutter_platform_node_delegate_win
4820648199
FILE: ../../../flutter/shell/platform/windows/flutter_platform_node_delegate_windows.h
4820748200
FILE: ../../../flutter/shell/platform/windows/flutter_project_bundle.cc
4820848201
FILE: ../../../flutter/shell/platform/windows/flutter_project_bundle.h
48202+
FILE: ../../../flutter/shell/platform/windows/flutter_host_window.cc
48203+
FILE: ../../../flutter/shell/platform/windows/flutter_host_window.h
48204+
FILE: ../../../flutter/shell/platform/windows/flutter_host_window_controller.cc
48205+
FILE: ../../../flutter/shell/platform/windows/flutter_host_window_controller.h
4820948206
FILE: ../../../flutter/shell/platform/windows/flutter_window.cc
4821048207
FILE: ../../../flutter/shell/platform/windows/flutter_window.h
4821148208
FILE: ../../../flutter/shell/platform/windows/flutter_windows.cc
@@ -48255,6 +48252,8 @@ FILE: ../../../flutter/shell/platform/windows/window_binding_handler_delegate.h
4825548252
FILE: ../../../flutter/shell/platform/windows/window_proc_delegate_manager.cc
4825648253
FILE: ../../../flutter/shell/platform/windows/window_proc_delegate_manager.h
4825748254
FILE: ../../../flutter/shell/platform/windows/window_state.h
48255+
FILE: ../../../flutter/shell/platform/windows/windowing_handler.cc
48256+
FILE: ../../../flutter/shell/platform/windows/windowing_handler.h
4825848257
FILE: ../../../flutter/shell/platform/windows/windows_lifecycle_manager.cc
4825948258
FILE: ../../../flutter/shell/platform/windows/windows_lifecycle_manager.h
4826048259
FILE: ../../../flutter/shell/platform/windows/windows_proc_table.cc

common/settings.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,10 @@ struct Settings {
367367
// If true, the UI thread is the platform thread on supported
368368
// platforms.
369369
bool merged_platform_ui_thread = true;
370+
371+
// Enable support for multiple windows. Ignored if not supported on the
372+
// platform.
373+
bool enable_multi_window = false;
370374
};
371375

372376
} // namespace flutter

shell/common/switches.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,17 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) {
532532
settings.merged_platform_ui_thread = !command_line.HasOption(
533533
FlagForSwitch(Switch::DisableMergedPlatformUIThread));
534534

535+
#if FML_OS_WIN
536+
// Process the EnableMultiWindow switch on Windows.
537+
{
538+
std::string enable_multi_window_value;
539+
if (command_line.GetOptionValue(FlagForSwitch(Switch::EnableMultiWindow),
540+
&enable_multi_window_value)) {
541+
settings.enable_multi_window = "true" == enable_multi_window_value;
542+
}
543+
}
544+
#endif // FML_OS_WIN
545+
535546
return settings;
536547
}
537548

shell/common/switches.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ DEF_SWITCH(DisableMergedPlatformUIThread,
300300
DEF_SWITCH(DisableAndroidSurfaceControl,
301301
"disable-surface-control",
302302
"Disable the SurfaceControl backed swapchain even when supported.")
303+
DEF_SWITCH(EnableMultiWindow,
304+
"enable-multi-window",
305+
"Enable support for multiple windows. Ignored if not supported on "
306+
"the platform.")
303307
DEF_SWITCHES_END
304308

305309
void PrintUsage(const std::string& executable_name);

shell/platform/common/BUILD.gn

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,13 @@ source_set("common_cpp_core") {
142142
public = [
143143
"geometry.h",
144144
"path_utils.h",
145+
"windowing.h",
145146
]
146147

147-
sources = [ "path_utils.cc" ]
148+
sources = [
149+
"path_utils.cc",
150+
"windowing.cc",
151+
]
148152

149153
public_configs = [ "//flutter:config" ]
150154
}
@@ -157,7 +161,10 @@ if (enable_unittests) {
157161
executable("common_cpp_core_unittests") {
158162
testonly = true
159163

160-
sources = [ "path_utils_unittests.cc" ]
164+
sources = [
165+
"path_utils_unittests.cc",
166+
"windowing_unittests.cc",
167+
]
161168

162169
deps = [
163170
":common_cpp_core",

shell/platform/common/client_wrapper/core_wrapper_files.gni

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ core_cpp_client_wrapper_includes =
2525
"include/flutter/standard_message_codec.h",
2626
"include/flutter/standard_method_codec.h",
2727
"include/flutter/texture_registrar.h",
28-
"include/flutter/windowing.h",
2928
],
3029
"abspath")
3130

0 commit comments

Comments
 (0)