Skip to content

Commit 0eb1994

Browse files
authored
Add support for multi-window popups on Windows (#16)
1 parent 69d88bb commit 0eb1994

20 files changed

+2991
-2
lines changed

engine/src/flutter/ci/licenses_golden/excluded_files

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,10 @@
402402
../../../flutter/shell/platform/windows/direct_manipulation_unittests.cc
403403
../../../flutter/shell/platform/windows/dpi_utils_unittests.cc
404404
../../../flutter/shell/platform/windows/fixtures
405+
../../../flutter/shell/platform/windows/flutter_host_window_controller_unittests.cc
405406
../../../flutter/shell/platform/windows/flutter_project_bundle_unittests.cc
406407
../../../flutter/shell/platform/windows/flutter_window_unittests.cc
408+
../../../flutter/shell/platform/windows/flutter_windowing_handler_unittests.cc
407409
../../../flutter/shell/platform/windows/flutter_windows_engine_unittests.cc
408410
../../../flutter/shell/platform/windows/flutter_windows_texture_registrar_unittests.cc
409411
../../../flutter/shell/platform/windows/flutter_windows_unittests.cc

engine/src/flutter/ci/licenses_golden/licenses_flutter

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43825,6 +43825,8 @@ ORIGIN: ../../../flutter/shell/platform/common/text_editing_delta.h + ../../../f
4382543825
ORIGIN: ../../../flutter/shell/platform/common/text_input_model.cc + ../../../flutter/LICENSE
4382643826
ORIGIN: ../../../flutter/shell/platform/common/text_input_model.h + ../../../flutter/LICENSE
4382743827
ORIGIN: ../../../flutter/shell/platform/common/text_range.h + ../../../flutter/LICENSE
43828+
ORIGIN: ../../../flutter/shell/platform/common/windowing.cc + ../../../flutter/LICENSE
43829+
ORIGIN: ../../../flutter/shell/platform/common/windowing.h + ../../../flutter/LICENSE
4382843830
ORIGIN: ../../../flutter/shell/platform/darwin/common/availability_version_check.cc + ../../../flutter/LICENSE
4382943831
ORIGIN: ../../../flutter/shell/platform/darwin/common/availability_version_check.h + ../../../flutter/LICENSE
4383043832
ORIGIN: ../../../flutter/shell/platform/darwin/common/buffer_conversions.h + ../../../flutter/LICENSE
@@ -44556,6 +44558,10 @@ ORIGIN: ../../../flutter/shell/platform/windows/flutter_platform_node_delegate_w
4455644558
ORIGIN: ../../../flutter/shell/platform/windows/flutter_platform_node_delegate_windows.h + ../../../flutter/LICENSE
4455744559
ORIGIN: ../../../flutter/shell/platform/windows/flutter_project_bundle.cc + ../../../flutter/LICENSE
4455844560
ORIGIN: ../../../flutter/shell/platform/windows/flutter_project_bundle.h + ../../../flutter/LICENSE
44561+
ORIGIN: ../../../flutter/shell/platform/windows/flutter_host_window.cc + ../../../flutter/LICENSE
44562+
ORIGIN: ../../../flutter/shell/platform/windows/flutter_host_window.h + ../../../flutter/LICENSE
44563+
ORIGIN: ../../../flutter/shell/platform/windows/flutter_host_window_controller.cc + ../../../flutter/LICENSE
44564+
ORIGIN: ../../../flutter/shell/platform/windows/flutter_host_window_controller.h + ../../../flutter/LICENSE
4455944565
ORIGIN: ../../../flutter/shell/platform/windows/flutter_window.cc + ../../../flutter/LICENSE
4456044566
ORIGIN: ../../../flutter/shell/platform/windows/flutter_window.h + ../../../flutter/LICENSE
4456144567
ORIGIN: ../../../flutter/shell/platform/windows/flutter_windows.cc + ../../../flutter/LICENSE
@@ -44605,6 +44611,8 @@ ORIGIN: ../../../flutter/shell/platform/windows/window_binding_handler_delegate.
4460544611
ORIGIN: ../../../flutter/shell/platform/windows/window_proc_delegate_manager.cc + ../../../flutter/LICENSE
4460644612
ORIGIN: ../../../flutter/shell/platform/windows/window_proc_delegate_manager.h + ../../../flutter/LICENSE
4460744613
ORIGIN: ../../../flutter/shell/platform/windows/window_state.h + ../../../flutter/LICENSE
44614+
ORIGIN: ../../../flutter/shell/platform/windows/windowing_handle.cc + ../../../flutter/LICENSE
44615+
ORIGIN: ../../../flutter/shell/platform/windows/windowing_handle.h + ../../../flutter/LICENSE
4460844616
ORIGIN: ../../../flutter/shell/platform/windows/windows_lifecycle_manager.cc + ../../../flutter/LICENSE
4460944617
ORIGIN: ../../../flutter/shell/platform/windows/windows_lifecycle_manager.h + ../../../flutter/LICENSE
4461044618
ORIGIN: ../../../flutter/shell/platform/windows/windows_proc_table.cc + ../../../flutter/LICENSE
@@ -46778,6 +46786,8 @@ FILE: ../../../flutter/shell/platform/common/text_editing_delta.h
4677846786
FILE: ../../../flutter/shell/platform/common/text_input_model.cc
4677946787
FILE: ../../../flutter/shell/platform/common/text_input_model.h
4678046788
FILE: ../../../flutter/shell/platform/common/text_range.h
46789+
FILE: ../../../flutter/shell/platform/common/windowing.cc
46790+
FILE: ../../../flutter/shell/platform/common/windowing.h
4678146791
FILE: ../../../flutter/shell/platform/darwin/common/availability_version_check.cc
4678246792
FILE: ../../../flutter/shell/platform/darwin/common/availability_version_check.h
4678346793
FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.h
@@ -47524,6 +47534,10 @@ FILE: ../../../flutter/shell/platform/windows/flutter_platform_node_delegate_win
4752447534
FILE: ../../../flutter/shell/platform/windows/flutter_platform_node_delegate_windows.h
4752547535
FILE: ../../../flutter/shell/platform/windows/flutter_project_bundle.cc
4752647536
FILE: ../../../flutter/shell/platform/windows/flutter_project_bundle.h
47537+
FILE: ../../../flutter/shell/platform/windows/flutter_host_window.cc
47538+
FILE: ../../../flutter/shell/platform/windows/flutter_host_window.h
47539+
FILE: ../../../flutter/shell/platform/windows/flutter_host_window_controller.cc
47540+
FILE: ../../../flutter/shell/platform/windows/flutter_host_window_controller.h
4752747541
FILE: ../../../flutter/shell/platform/windows/flutter_window.cc
4752847542
FILE: ../../../flutter/shell/platform/windows/flutter_window.h
4752947543
FILE: ../../../flutter/shell/platform/windows/flutter_windows.cc
@@ -47573,6 +47587,8 @@ FILE: ../../../flutter/shell/platform/windows/window_binding_handler_delegate.h
4757347587
FILE: ../../../flutter/shell/platform/windows/window_proc_delegate_manager.cc
4757447588
FILE: ../../../flutter/shell/platform/windows/window_proc_delegate_manager.h
4757547589
FILE: ../../../flutter/shell/platform/windows/window_state.h
47590+
FILE: ../../../flutter/shell/platform/windows/windowing_handler.cc
47591+
FILE: ../../../flutter/shell/platform/windows/windowing_handler.h
4757647592
FILE: ../../../flutter/shell/platform/windows/windows_lifecycle_manager.cc
4757747593
FILE: ../../../flutter/shell/platform/windows/windows_lifecycle_manager.h
4757847594
FILE: ../../../flutter/shell/platform/windows/windows_proc_table.cc

engine/src/flutter/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

engine/src/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

engine/src/flutter/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);

engine/src/flutter/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",

0 commit comments

Comments
 (0)