15 const BoxConstraints& constraints,
19 get_position_callback_(get_position_callback),
24 auto const initial_width =
25 static_cast<double>(constraints.smallest().width());
26 auto const initial_height =
27 static_cast<double>(constraints.smallest().height());
31 .window_style = WS_POPUP,
32 .extended_window_style = WS_EX_NOACTIVATE | WS_EX_TOOLWINDOW,
33 .box_constraints = constraints,
34 .initial_window_rect = {{0, 0}, {initial_width, initial_height}},
36 .owner_window = parent,
37 .nCmdShow = SW_SHOWNOACTIVATE,
39 .is_sized_to_content =
true});
51 int32_t physical_height) {
55 WindowRect HostWindowPopup::GetWorkArea()
const {
60 RECT parent_client_rect;
61 GetClientRect(parent_, &parent_client_rect);
64 POINT parent_top_left = {parent_client_rect.left, parent_client_rect.top};
65 POINT parent_bottom_right = {parent_client_rect.right,
66 parent_client_rect.bottom};
68 ClientToScreen(parent_, &parent_top_left);
69 ClientToScreen(parent_, &parent_bottom_right);
72 HMONITOR monitor = MonitorFromWindow(parent_, MONITOR_DEFAULTTONEAREST);
79 WindowRect{parent_top_left.x, parent_top_left.y,
80 parent_bottom_right.x - parent_top_left.x,
81 parent_bottom_right.y - parent_top_left.y},
84 SetWindowPos(
window_handle_, HWND_TOP, rect.left, rect.top, rect.width,
85 rect.height, SWP_NOACTIVATE | SWP_NOOWNERZORDER);
void InitializeFlutterView(HostWindowInitializationParams const ¶ms)
std::unique_ptr< FlutterWindowsViewController > view_controller_
static WindowRect GetWorkAreaForWindow(HWND hwnd)
FlutterWindowsViewSizingDelegate * AsSizingDelegate()
void(* GetWindowPositionCallback)(const WindowSize &child_size, const WindowRect &parent_rect, const WindowRect &display_rect, WindowRect &output_rect)
WindowArchetype archetype