Skip to content

fix(windows): sync FLUTTERVIEW directly and defer post-DWM resize on fullscreen - #114

Open
lijy91 wants to merge 1 commit into
mainfrom
fix/windows-fullscreen-flutterview-issue-79
Open

lijy91 wants to merge 1 commit into
mainfrom
fix/windows-fullscreen-flutterview-issue-79

Conversation

@lijy91

@lijy91 lijy91 commented Dec 2, 2026

Copy link
Copy Markdown
Member

Fixes libnativeapi/nativeapi#79.

Root Cause

  • SyncFullScreenClientArea previously only sent WM_SIZE synchronously to the top-level host HWND inside Window::SetFullScreen. When SetWindowPos had already moved/sized the child FLUTTERVIEW HWND to the new rect during the synchronous FFI call (while Dart was still blocked in FFI or before dwm.exe finished its async WM_DWMNCRENDERINGCHANGED fullscreen transition), Win32Window's MoveWindow(child_content_, ...) saw an unchanged rect and skipped sending WM_SIZE to FLUTTERVIEW, leaving the Flutter/ANGLE surface at the stale size.

Fix

  • In SyncFullScreenClientArea, explicitly find any FLUTTERVIEW child, align its rect if mismatched, send WM_SIZE and RedrawWindow directly to FLUTTERVIEW, and preserve child keyboard focus when the window is foreground.
  • Schedule a deferred PostMessageW(..., SyncFullScreenClientMessage(), ...) re-sync on the next message-loop turn (after SetFullScreen returns to the caller) and re-trigger once dwm.exe delivers WM_DWMNCRENDERINGCHANGED.
  • Extended window_fullscreen_hidden_titlebar_windows_test to verify immediate and deferred WM_SIZE delivery to a FLUTTERVIEW child on both enter and exit fullscreen.

Verification

  • Built and passed ctest -C Release -R window_fullscreen_hidden_titlebar_windows_test on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: isFullScreen still leaves Flutter surface at wrong size after #60 / 0.6.3 (SyncFullScreenClientArea)

1 participant