Repository navigation
Sync Windows fullscreen client size and preserve hidden-titlebar DWM borders - #105
Merged
Merged
Conversation
lijy91
force-pushed
the
fix/windows-fullscreen-hidden-titlebar-issue-60
branch
from
November 30, 2026 23:55
bc754a4 to
bbfb708
Compare
lijy91
force-pushed
the
fix/windows-fullscreen-hidden-titlebar-issue-60
branch
from
December 1, 2026 00:02
bbfb708 to
cb2f41a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes libnativeapi/nativeapi#60.
Root Cause
SWP_NOSIZE | SWP_FRAMECHANGEDafterSetWindowPlacementdid not reliably re-emitWM_SIZEwith the post-frame-change client rect or force an immediate child repaint, leaving child surfaces such as Flutter'sFLUTTERVIEWunsized or overflowing until a focus change (Alt+Tab).TitleBarStyle::Hiddenwindow,dwm.exedetaches non-client rendering in fullscreen (WM_DWMNCRENDERINGCHANGEDwithwParam = FALSE) and only re-attaches asynchronously afterSetFullScreen(false)returns. During that transition window,SWP_FRAMECHANGEDsendsWM_NCPAINTwithwParam = 1, causingDefWindowProcW(andDrawMenuBar) to paint classic Aero Basic / Windows 7 caption and border pixels onto the window's redirection bitmap.Changes
SyncFullScreenClientAreainsrc/platform/windows/window_windows.cppto deliverWM_SIZEwith the finalGetClientRectand immediately invalidate/update client and child windows on both fullscreen entry and exit.WM_DWMNCRENDERINGCHANGED(0x031F) viakDwmNcDisabledProperty; while detached on a compositor-framedTitleBarStyle::Hiddenwindow, preserved the top client band across untouchedDefSubclassProc(WM_NCPAINT)and cleared non-client resize borders (WindowRect - ClientRect) to transparent black (plus once onWM_DWMNCRENDERINGCHANGED(TRUE)), preserving Windows 11 rounded corners and shadow with zero classic title bar flash or border residue.WM_NCUAHDRAWCAPTION/WM_NCUAHDRAWFRAMEon all hidden-title-bar windows, skippedDrawMenuBarwhen the title bar is hidden, and collapsed the redundant secondSWP_FRAMECHANGEDinSetFullScreen(false).tests/window_fullscreen_hidden_titlebar_windows_test.cppverifying normal and maximized fullscreen round-trips, child surface sizing, zero top-band classic caption overdraw, and transparent DWM resize borders.