Flutter Windows Embedder
window_manager.cc File Reference

Go to the source code of this file.

Namespaces

 flutter
 

Functions

void InternalFlutterWindows_WindowManager_Initialize (int64_t engine_id, const flutter::WindowingInitRequest *request)
 
FlutterViewId InternalFlutterWindows_WindowManager_CreateRegularWindow (int64_t engine_id, const flutter::RegularWindowCreationRequest *request)
 
FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreateDialogWindow (int64_t engine_id, const flutter::DialogWindowCreationRequest *request)
 
FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreateTooltipWindow (int64_t engine_id, const flutter::TooltipWindowCreationRequest *request)
 
FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreatePopupWindow (int64_t engine_id, const flutter::PopupWindowCreationRequest *request)
 
HWND InternalFlutterWindows_WindowManager_GetTopLevelWindowHandle (int64_t engine_id, FlutterViewId view_id)
 
flutter::ActualWindowSize InternalFlutterWindows_WindowManager_GetWindowContentSize (HWND hwnd)
 
void InternalFlutterWindows_WindowManager_SetWindowSize (HWND hwnd, const flutter::WindowSizeRequest *size)
 
void InternalFlutterWindows_WindowManager_OnDestroyWindow (HWND hwnd)
 
void InternalFlutterWindows_WindowManager_SetWindowConstraints (HWND hwnd, const flutter::WindowConstraints *constraints)
 
void InternalFlutterWindows_WindowManager_SetFullscreen (HWND hwnd, const flutter::FullscreenRequest *request)
 
bool InternalFlutterWindows_WindowManager_GetFullscreen (HWND hwnd)
 
FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_UpdateTooltipPosition (HWND hwnd)
 
FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_UpdatePopupPosition (HWND hwnd)
 

Function Documentation

◆ InternalFlutterWindows_WindowManager_CreateDialogWindow()

FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreateDialogWindow ( int64_t  engine_id,
const flutter::DialogWindowCreationRequest request 
)

Definition at line 164 of file window_manager.cc.

166  {
169  return engine->window_manager()->CreateDialogWindow(request);
170 }
static FlutterWindowsEngine * GetEngineForId(int64_t engine_id)
FlutterViewId CreateDialogWindow(const DialogWindowCreationRequest *request)

References flutter::WindowManager::CreateDialogWindow(), flutter::FlutterWindowsEngine::GetEngineForId(), and flutter::FlutterWindowsEngine::window_manager().

Referenced by flutter::testing::TEST_F().

◆ InternalFlutterWindows_WindowManager_CreatePopupWindow()

FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreatePopupWindow ( int64_t  engine_id,
const flutter::PopupWindowCreationRequest request 
)

Definition at line 182 of file window_manager.cc.

184  {
187  return engine->window_manager()->CreatePopupWindow(request);
188 }
FlutterViewId CreatePopupWindow(const PopupWindowCreationRequest *request)

References flutter::WindowManager::CreatePopupWindow(), flutter::FlutterWindowsEngine::GetEngineForId(), and flutter::FlutterWindowsEngine::window_manager().

Referenced by flutter::testing::TEST_F().

◆ InternalFlutterWindows_WindowManager_CreateRegularWindow()

FlutterViewId InternalFlutterWindows_WindowManager_CreateRegularWindow ( int64_t  engine_id,
const flutter::RegularWindowCreationRequest request 
)

Definition at line 155 of file window_manager.cc.

157  {
160  return engine->window_manager()->CreateRegularWindow(request);
161 }
FlutterViewId CreateRegularWindow(const RegularWindowCreationRequest *request)

References flutter::WindowManager::CreateRegularWindow(), flutter::FlutterWindowsEngine::GetEngineForId(), and flutter::FlutterWindowsEngine::window_manager().

Referenced by flutter::testing::TEST_F().

◆ InternalFlutterWindows_WindowManager_CreateTooltipWindow()

FLUTTER_EXPORT FlutterViewId InternalFlutterWindows_WindowManager_CreateTooltipWindow ( int64_t  engine_id,
const flutter::TooltipWindowCreationRequest request 
)

Definition at line 173 of file window_manager.cc.

175  {
178  return engine->window_manager()->CreateTooltipWindow(request);
179 }
FlutterViewId CreateTooltipWindow(const TooltipWindowCreationRequest *request)

References flutter::WindowManager::CreateTooltipWindow(), flutter::FlutterWindowsEngine::GetEngineForId(), and flutter::FlutterWindowsEngine::window_manager().

Referenced by flutter::testing::TEST_F().

◆ InternalFlutterWindows_WindowManager_GetFullscreen()

bool InternalFlutterWindows_WindowManager_GetFullscreen ( HWND  hwnd)

Definition at line 259 of file window_manager.cc.

259  {
261  if (window) {
262  return window->GetFullscreen();
263  }
264 
265  return false;
266 }
static HostWindow * GetThisFromHandle(HWND hwnd)
Definition: host_window.cc:326
virtual bool GetFullscreen() const
Definition: host_window.cc:734

References flutter::HostWindow::GetFullscreen(), and flutter::HostWindow::GetThisFromHandle().

Referenced by flutter::testing::TEST_F().

◆ InternalFlutterWindows_WindowManager_GetTopLevelWindowHandle()

HWND InternalFlutterWindows_WindowManager_GetTopLevelWindowHandle ( int64_t  engine_id,
FlutterViewId  view_id 
)

Definition at line 190 of file window_manager.cc.

192  {
195  flutter::FlutterWindowsView* view = engine->view(view_id);
196  if (view == nullptr) {
197  return nullptr;
198  } else {
199  return GetAncestor(view->GetWindowHandle(), GA_ROOT);
200  }
201 }
FlutterWindowsView * view(FlutterViewId view_id) const
virtual HWND GetWindowHandle() const

References flutter::FlutterWindowsEngine::GetEngineForId(), flutter::FlutterWindowsView::GetWindowHandle(), and flutter::FlutterWindowsEngine::view().

Referenced by flutter::testing::TEST_F().

◆ InternalFlutterWindows_WindowManager_GetWindowContentSize()

flutter::ActualWindowSize InternalFlutterWindows_WindowManager_GetWindowContentSize ( HWND  hwnd)

Definition at line 204 of file window_manager.cc.

204  {
206 }
static ActualWindowSize GetWindowContentSize(HWND hwnd)
Definition: host_window.cc:738

References flutter::HostWindow::GetWindowContentSize().

Referenced by flutter::testing::TEST_F().

◆ InternalFlutterWindows_WindowManager_Initialize()

void InternalFlutterWindows_WindowManager_Initialize ( int64_t  engine_id,
const flutter::WindowingInitRequest request 
)

◆ InternalFlutterWindows_WindowManager_OnDestroyWindow()

void InternalFlutterWindows_WindowManager_OnDestroyWindow ( HWND  hwnd)

Definition at line 217 of file window_manager.cc.

217  {
219  HWND flutter_view_handle = nullptr;
220  if (window) {
221  // First reparent the FlutterView to null parent. Otherwise destroying
222  // the window HWND will immediately destroy the FlutterView HWND as well,
223  // which will cause crash when raster thread tries to reallocate surface.
224  // The FlutterView may only be destroyed safely when
225  // FlutterWindowsEngine::RemoveView finishes.
226  flutter_view_handle = window->GetFlutterViewWindowHandle();
227  ShowWindow(flutter_view_handle, SW_HIDE);
228  SetParent(flutter_view_handle, nullptr);
229  }
230  DestroyWindow(hwnd);
231  if (flutter_view_handle) {
232  // Now the flutter view HWND can be destroyed safely.
233  DestroyWindow(flutter_view_handle);
234  }
235 }
HWND GetFlutterViewWindowHandle() const
Definition: host_window.cc:345

References flutter::HostWindow::GetFlutterViewWindowHandle(), and flutter::HostWindow::GetThisFromHandle().

Referenced by flutter::WindowManager::OnEngineShutdown().

◆ InternalFlutterWindows_WindowManager_SetFullscreen()

void InternalFlutterWindows_WindowManager_SetFullscreen ( HWND  hwnd,
const flutter::FullscreenRequest request 
)

Definition at line 246 of file window_manager.cc.

248  {
250  const std::optional<FlutterEngineDisplayId> display_id =
251  request->has_display_id
252  ? std::optional<FlutterEngineDisplayId>(request->display_id)
253  : std::nullopt;
254  if (window) {
255  window->SetFullscreen(request->fullscreen, display_id);
256  }
257 }
virtual void SetFullscreen(bool fullscreen, std::optional< FlutterEngineDisplayId > display_id)
Definition: host_window.cc:588
FlutterEngineDisplayId display_id

References flutter::FullscreenRequest::display_id, flutter::FullscreenRequest::fullscreen, flutter::HostWindow::GetThisFromHandle(), flutter::FullscreenRequest::has_display_id, and flutter::HostWindow::SetFullscreen().

Referenced by flutter::testing::TEST_F().

◆ InternalFlutterWindows_WindowManager_SetWindowConstraints()

void InternalFlutterWindows_WindowManager_SetWindowConstraints ( HWND  hwnd,
const flutter::WindowConstraints constraints 
)

Definition at line 237 of file window_manager.cc.

239  {
241  if (window) {
242  window->SetConstraints(*constraints);
243  }
244 }
void SetConstraints(const WindowConstraints &constraints)
Definition: host_window.cc:547

References flutter::HostWindow::GetThisFromHandle(), and flutter::HostWindow::SetConstraints().

Referenced by flutter::testing::TEST_F().

◆ InternalFlutterWindows_WindowManager_SetWindowSize()

void InternalFlutterWindows_WindowManager_SetWindowSize ( HWND  hwnd,
const flutter::WindowSizeRequest size 
)

Definition at line 208 of file window_manager.cc.

210  {
212  if (window) {
213  window->SetContentSize(*size);
214  }
215 }
void SetContentSize(const WindowSizeRequest &size)
Definition: host_window.cc:505

References flutter::HostWindow::GetThisFromHandle(), and flutter::HostWindow::SetContentSize().

Referenced by flutter::testing::TEST_F().

◆ InternalFlutterWindows_WindowManager_UpdatePopupPosition()

FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_UpdatePopupPosition ( HWND  hwnd)

◆ InternalFlutterWindows_WindowManager_UpdateTooltipPosition()

FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_UpdateTooltipPosition ( HWND  hwnd)