Win32: Fix window animations in extended mode#21498
Merged
Merged
Conversation
kekekeks
approved these changes
Jun 3, 2026
|
You can test this PR using the following package version. |
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.
What does the pull request do?
This PR restores the window animations on Windows when
WindowDecorations = FullandExtendClientAreaToDecorationsHint = Truein both Windows 10 and 11.Notes
The animations were broken by #21412. The changes from this PR are partially reverted here.
WS_CAPTIONis now enforced again inFulldecorations mode, as it's the style Windows uses to trigger animations.The comment in #21412 is still valid: as soon as we reserve a single pixel for the caption (to use as the top border), Windows 10 draws the full height caption (Windows 11 handles that scenario correctly). To prevent that, the solution seems obvious: do not reserve any height for that top border.
I spent hours looking at how Chromium and various modern applications with custom chrome (Calculator, Windows Explorer, Windows Settings...) do things, by analyzing styles and messages.
The result is always the same: the caption / top border is 0 as specified in Chromium's source code to avoid the duplicated caption described above. The top border is then drawn manually. Interestingly, this is also the case in Windows Settings or Calculator: a bug exists in Windows 10 where changing the frame color isn't always updated, and it's noticeable that the top border isn't the same color as the rest of the frame.
Note that this PR does not try to draw that extra top border on Windows 10 (Windows 11 does not need it).
Tested against Windows 10 22H2 (19045) and Windows 11 25H2 (26200).
Fixed issues
Windowanimations is lost whenExtendClientAreaToDecorationsHint="True"#21456