Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
window_manager.h File Reference
#include <windows.h>
#include <functional>
#include <optional>
#include <unordered_map>
#include <vector>
#include "flutter/shell/platform/common/public/flutter_export.h"
#include "flutter/fml/macros.h"
#include "flutter/shell/platform/common/isolate_scope.h"
#include "flutter/shell/platform/embedder/embedder.h"

Go to the source code of this file.

Classes

struct  flutter::WindowSizeRequest
 
struct  flutter::WindowConstraints
 
struct  flutter::WindowRect
 
struct  flutter::WindowSize
 
struct  flutter::RegularWindowCreationRequest
 
struct  flutter::DialogWindowCreationRequest
 
struct  flutter::TooltipWindowCreationRequest
 
struct  flutter::WindowsMessage
 
struct  flutter::WindowingInitRequest
 
struct  flutter::ActualWindowSize
 
struct  flutter::FullscreenRequest
 
class  flutter::WindowManager
 

Namespaces

namespace  flutter
 

Typedefs

typedef WindowRect *(* flutter::GetWindowPositionCallback) (const WindowSize &child_size, const WindowRect &parent_rect, const WindowRect &output_rect)
 

Functions

FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_Initialize (int64_t engine_id, const flutter::WindowingInitRequest *request)
 
FLUTTER_EXPORT 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 HWND InternalFlutterWindows_WindowManager_GetTopLevelWindowHandle (int64_t engine_id, FlutterViewId view_id)
 
FLUTTER_EXPORT flutter::ActualWindowSize InternalFlutterWindows_WindowManager_GetWindowContentSize (HWND hwnd)
 
FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_SetWindowSize (HWND hwnd, const flutter::WindowSizeRequest *size)
 
FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_SetWindowConstraints (HWND hwnd, const flutter::WindowConstraints *constraints)
 
FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_SetFullscreen (HWND hwnd, const flutter::FullscreenRequest *request)
 
FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_OnDestroyWindow (HWND hwnd)
 
FLUTTER_EXPORT 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 149 of file window_manager.cc.

151 {
154 return engine->window_manager()->CreateDialogWindow(request);
155}
static FlutterWindowsEngine * GetEngineForId(int64_t engine_id)
FlutterEngine engine
Definition main.cc:84

References engine, and flutter::FlutterWindowsEngine::GetEngineForId().

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

◆ InternalFlutterWindows_WindowManager_CreateRegularWindow()

◆ InternalFlutterWindows_WindowManager_CreateTooltipWindow()

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

◆ InternalFlutterWindows_WindowManager_GetFullscreen()

FLUTTER_EXPORT bool InternalFlutterWindows_WindowManager_GetFullscreen ( HWND  hwnd)

Definition at line 235 of file window_manager.cc.

235 {
237 if (window) {
238 return window->GetFullscreen();
239 }
240
241 return false;
242}
static HostWindow * GetThisFromHandle(HWND hwnd)
GLFWwindow * window
Definition main.cc:60

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

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

◆ InternalFlutterWindows_WindowManager_GetTopLevelWindowHandle()

◆ InternalFlutterWindows_WindowManager_GetWindowContentSize()

◆ InternalFlutterWindows_WindowManager_Initialize()

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

Definition at line 132 of file window_manager.cc.

134 {
137 engine->window_manager()->Initialize(request);
138}

References engine, and flutter::FlutterWindowsEngine::GetEngineForId().

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

◆ InternalFlutterWindows_WindowManager_OnDestroyWindow()

FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_OnDestroyWindow ( HWND  hwnd)

Definition at line 193 of file window_manager.cc.

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

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

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

◆ InternalFlutterWindows_WindowManager_SetFullscreen()

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

Definition at line 222 of file window_manager.cc.

224 {
226 const std::optional<FlutterEngineDisplayId> display_id =
227 request->has_display_id
228 ? std::optional<FlutterEngineDisplayId>(request->display_id)
229 : std::nullopt;
230 if (window) {
231 window->SetFullscreen(request->fullscreen, display_id);
232 }
233}
Definition ref_ptr.h:261
FlutterEngineDisplayId display_id

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

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

◆ InternalFlutterWindows_WindowManager_SetWindowConstraints()

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

Definition at line 213 of file window_manager.cc.

215 {
217 if (window) {
218 window->SetConstraints(*constraints);
219 }
220}

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

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

◆ InternalFlutterWindows_WindowManager_SetWindowSize()

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

Definition at line 184 of file window_manager.cc.

186 {
188 if (window) {
189 window->SetContentSize(*size);
190 }
191}

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

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

◆ InternalFlutterWindows_WindowManager_UpdateTooltipPosition()

FLUTTER_EXPORT void InternalFlutterWindows_WindowManager_UpdateTooltipPosition ( HWND  hwnd)