Skip to content

Win32: Fix window animations in extended mode#21498

Merged
MrJul merged 1 commit into
AvaloniaUI:masterfrom
MrJul:fix/win32-extended-anims
Jun 3, 2026
Merged

Win32: Fix window animations in extended mode#21498
MrJul merged 1 commit into
AvaloniaUI:masterfrom
MrJul:fix/win32-extended-anims

Conversation

@MrJul

@MrJul MrJul commented Jun 3, 2026

Copy link
Copy Markdown
Member

What does the pull request do?

This PR restores the window animations on Windows when WindowDecorations = Full and ExtendClientAreaToDecorationsHint = True in both Windows 10 and 11.

Notes

The animations were broken by #21412. The changes from this PR are partially reverted here. WS_CAPTION is now enforced again in Full decorations 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

@MrJul MrJul added bug os-windows backport-candidate-12.0.x Consider this PR for backporting to 12.0 branch labels Jun 3, 2026
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0066000-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul enabled auto-merge June 3, 2026 22:19
@MrJul MrJul added this pull request to the merge queue Jun 3, 2026
Merged via the queue into AvaloniaUI:master with commit 30243cb Jun 3, 2026
12 checks passed
@MrJul MrJul deleted the fix/win32-extended-anims branch June 3, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-candidate-12.0.x Consider this PR for backporting to 12.0 branch bug os-windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Window animations is lost when ExtendClientAreaToDecorationsHint="True"

3 participants