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)
 
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)
 

Function Documentation

◆ InternalFlutterWindows_WindowManager_CreateDialogWindow()

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

Definition at line 148 of file window_manager.cc.

150  {
153  return engine->window_manager()->CreateDialogWindow(request);
154 }
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_CreateRegularWindow()

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

Definition at line 139 of file window_manager.cc.

141  {
144  return engine->window_manager()->CreateRegularWindow(request);
145 }
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 157 of file window_manager.cc.

159  {
162  return engine->window_manager()->CreateTooltipWindow(request);
163 }
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 234 of file window_manager.cc.

234  {
236  if (window) {
237  return window->GetFullscreen();
238  }
239 
240  return false;
241 }
static HostWindow * GetThisFromHandle(HWND hwnd)
Definition: host_window.cc:337
virtual bool GetFullscreen() const
Definition: host_window.cc:722

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 165 of file window_manager.cc.

167  {
170  flutter::FlutterWindowsView* view = engine->view(view_id);
171  if (view == nullptr) {
172  return nullptr;
173  } else {
174  return GetAncestor(view->GetWindowHandle(), GA_ROOT);
175  }
176 }
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 179 of file window_manager.cc.

179  {
181 }
static ActualWindowSize GetWindowContentSize(HWND hwnd)
Definition: host_window.cc:726

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 192 of file window_manager.cc.

192  {
194  HWND flutter_view_handle = nullptr;
195  if (window) {
196  // First reparent the FlutterView to null parent. Otherwise destroying
197  // the window HWND will immediately destroy the FlutterView HWND as well,
198  // which will cause crash when raster thread tries to reallocate surface.
199  // The FlutterView may only be destroyed safely when
200  // FlutterWindowsEngine::RemoveView finishes.
201  flutter_view_handle = window->GetFlutterViewWindowHandle();
202  ShowWindow(flutter_view_handle, SW_HIDE);
203  SetParent(flutter_view_handle, nullptr);
204  }
205  DestroyWindow(hwnd);
206  if (flutter_view_handle) {
207  // Now the flutter view HWND can be destroyed safely.
208  DestroyWindow(flutter_view_handle);
209  }
210 }
HWND GetFlutterViewWindowHandle() const
Definition: host_window.cc:356

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 221 of file window_manager.cc.

223  {
225  const std::optional<FlutterEngineDisplayId> display_id =
226  request->has_display_id
227  ? std::optional<FlutterEngineDisplayId>(request->display_id)
228  : std::nullopt;
229  if (window) {
230  window->SetFullscreen(request->fullscreen, display_id);
231  }
232 }
virtual void SetFullscreen(bool fullscreen, std::optional< FlutterEngineDisplayId > display_id)
Definition: host_window.cc:576
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 212 of file window_manager.cc.

214  {
216  if (window) {
217  window->SetConstraints(*constraints);
218  }
219 }
void SetConstraints(const WindowConstraints &constraints)
Definition: host_window.cc:535

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 183 of file window_manager.cc.

185  {
187  if (window) {
188  window->SetContentSize(*size);
189  }
190 }
void SetContentSize(const WindowSizeRequest &size)
Definition: host_window.cc:493

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

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

◆ InternalFlutterWindows_WindowManager_UpdateTooltipPosition()

FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_UpdateTooltipPosition ( HWND  hwnd)