| Flutter Windows Embedder |

Public Member Functions | Protected Member Functions | List of all members
flutter::HostWindowDialog Class Reference

`#include <host_window_dialog.h>`

Inheritance diagram for flutter::HostWindowDialog:

## Public Member Functions
| HostWindowDialog (WindowManager *window_manager, FlutterWindowsEngine *engine, const WindowSizeRequest &preferred_size, const BoxConstraints &constraints, LPCWSTR title, std::optional< HWND > const &owner_window)
void | SetFullscreen (bool fullscreen, std::optional< FlutterEngineDisplayId > display_id) override
bool | GetFullscreen () const override
Public Member Functions inherited from flutter::HostWindow
virtual | ~HostWindow ()
HWND | GetWindowHandle () const
void | SetContentSize (const WindowSizeRequest &size)
void | SetConstraints (const WindowConstraints &constraints)
HostWindow * | GetOwnerWindow () const
void | UpdateModalStateLayer ()

## Protected Member Functions
LRESULT | HandleMessage (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) override
Protected Member Functions inherited from flutter::HostWindow
| HostWindow (WindowManager *window_manager, FlutterWindowsEngine *engine, WindowArchetype archetype, DWORD window_style, DWORD extended_window_style, const BoxConstraints &box_constraints, Rect const initial_window_rect, LPCWSTR title, std::optional< HWND > const &owner_window)
void | EnableRecursively (bool enable)
HostWindow * | FindFirstEnabledDescendant () const
std::vector< HostWindow * > | GetOwnedWindows () const
void | DisableRecursively ()
| FML_DISALLOW_COPY_AND_ASSIGN (HostWindow)

## Additional Inherited Members
Static Public Member Functions inherited from flutter::HostWindow
static std::unique_ptr< HostWindow > | CreateRegularWindow (WindowManager *window_manager, FlutterWindowsEngine *engine, const WindowSizeRequest &preferred_size, const WindowConstraints &preferred_constraints, LPCWSTR title)
static std::unique_ptr< HostWindow > | CreateDialogWindow (WindowManager *window_manager, FlutterWindowsEngine *engine, const WindowSizeRequest &preferred_size, const WindowConstraints &preferred_constraints, LPCWSTR title, HWND parent)
static HostWindow * | GetThisFromHandle (HWND hwnd)
static ActualWindowSize | GetWindowContentSize (HWND hwnd)
Static Protected Member Functions inherited from flutter::HostWindow
static std::optional< Size > | GetWindowSizeForClientSize (WindowsProcTable const &win32, Size const &client_size, std::optional< Size > smallest, std::optional< Size > biggest, DWORD window_style, DWORD extended_window_style, std::optional< HWND > const &owner_hwnd)
static void | FocusRootViewOf (HostWindow *window)
static LRESULT | WndProc (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
Protected Attributes inherited from flutter::HostWindow
friend | WindowManager
WindowManager *const | window_manager_ = nullptr
FlutterWindowsEngine * | engine_
std::unique_ptr< FlutterWindowsViewController > | view_controller_
WindowArchetype | archetype_ = WindowArchetype::kRegular
HWND | window_handle_
BoxConstraints | box_constraints_
bool | is_being_destroyed_ = false
bool | is_fullscreen_ = false
SavedWindowInfo | saved_window_info_
Microsoft::WRL::ComPtr< ITaskbarList2 > | task_bar_list_

## Detailed Description

Definition at line 11 of file host_window_dialog.h.

## Constructor & Destructor Documentation

## ◆ HostWindowDialog()

flutter::HostWindowDialog::HostWindowDialog | ( | WindowManager * | window_manager,
|  | FlutterWindowsEngine * | engine,
|  | const WindowSizeRequest & | preferred_size,
|  | const BoxConstraints & | constraints,
|  | LPCWSTR | title,
|  | std::optional< HWND > const & | owner_window
| ) |  |

Definition at line 35 of file host_window_dialog.cc.

41 : HostWindow(
42 window_manager,
43 engine,
44 WindowArchetype::kDialog,
45 GetWindowStyleForDialog(owner_window),
46 GetExtendedWindowStyleForDialog(owner_window),
47 constraints,
48 GetInitialRect(engine, preferred_size, constraints, owner_window),
49 title,
50 owner_window) {
51 auto hwnd = window_handle_;
52 if (owner_window == nullptr) {
53 if (HMENU hMenu = GetSystemMenu(hwnd, FALSE)) {
54 EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);
55 }
56 }
57
58 if (owner_window != nullptr) {
59 UpdateModalState();
60 }
61 }
flutter::HostWindow::window_handle_
HWND window_handle_
Definition: host_window.h:199
flutter::HostWindow::HostWindow
HostWindow(WindowManager *window_manager, FlutterWindowsEngine *engine, WindowArchetype archetype, DWORD window_style, DWORD extended_window_style, const BoxConstraints &box_constraints, Rect const initial_window_rect, LPCWSTR title, std::optional< HWND > const &owner_window)
Definition: host_window.cc:228
flutter::WindowArchetype::kDialog
@ kDialog

References flutter::kDialog, and flutter::HostWindow::window_handle_.

## Member Function Documentation

## ◆ GetFullscreen()

bool flutter::HostWindowDialog::GetFullscreen | ( |  | ) | const
| override virtual

Reimplemented from flutter::HostWindow.

Definition at line 138 of file host_window_dialog.cc.

138 {
139 return false;
140 }

## ◆ HandleMessage()

LRESULT flutter::HostWindowDialog::HandleMessage | ( | HWND | hwnd,
|  | UINT | message,
|  | WPARAM | wparam,
|  | LPARAM | lparam
| ) |  |
| override protected virtual

Reimplemented from flutter::HostWindow.

Definition at line 91 of file host_window_dialog.cc.

94 {
95 switch (message) {
96 case WM_DESTROY:
97 is_being_destroyed_ = true;
98 if (HostWindow* const owner_window = GetOwnerWindow()) {
99 UpdateModalState();
100 FocusRootViewOf(owner_window);
101 }
102 break;
103
104 case WM_ACTIVATE:
105 if (LOWORD(wparam) != WA_INACTIVE) {
106 // Prevent disabled window from being activated using the task
107 // switcher.
108 if (!IsWindowEnabled(hwnd)) {
109 // Redirect focus and activation to the first enabled descendant.
110 if (HostWindow* enabled_descendant = FindFirstEnabledDescendant()) {
111 SetActiveWindow(enabled_descendant->GetWindowHandle());
112 FocusRootViewOf(this);
113 }
114 return 0;
115 }
116 FocusRootViewOf(this);
117 }
118 return 0;
119 }
120
121 return HostWindow::HandleMessage(hwnd, message, wparam, lparam);
122 }
flutter::HostWindow::GetOwnerWindow
HostWindow * GetOwnerWindow() const
Definition: host_window.cc:817
flutter::HostWindow::is_being_destroyed_
bool is_being_destroyed_
Definition: host_window.h:205
flutter::HostWindow::FocusRootViewOf
static void FocusRootViewOf(HostWindow *window)
Definition: host_window.cc:346
flutter::HostWindow::HandleMessage
virtual LRESULT HandleMessage(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
Definition: host_window.cc:370
flutter::HostWindow::FindFirstEnabledDescendant
HostWindow * FindFirstEnabledDescendant() const
Definition: host_window.cc:780
message
Win32Message message
Definition: keyboard_unittests.cc:137

References flutter::HostWindow::FindFirstEnabledDescendant(), flutter::HostWindow::FocusRootViewOf(), flutter::HostWindow::GetOwnerWindow(), flutter::HostWindow::HandleMessage(), flutter::HostWindow::is_being_destroyed_, and message.

## ◆ SetFullscreen()

void flutter::HostWindowDialog::SetFullscreen | ( | bool | fullscreen,
|  | std::optional< FlutterEngineDisplayId > | display_id
| ) |  |
| override virtual

Reimplemented from flutter::HostWindow.

Definition at line 134 of file host_window_dialog.cc.

136 {}

The documentation for this class was generated from the following files:

- shell/platform/windows/host_window_dialog.h
- shell/platform/windows/host_window_dialog.cc