Skip to content

Fix Safe Area calc in drawer page#21050

Open
emmauss wants to merge 2 commits intomasterfrom
fix_safearea_drawerpage
Open

Fix Safe Area calc in drawer page#21050
emmauss wants to merge 2 commits intomasterfrom
fix_safearea_drawerpage

Conversation

@emmauss
Copy link
Copy Markdown
Contributor

@emmauss emmauss commented Mar 31, 2026

What does the pull request do?

Fixes safe area calculation for DrawerPage and applies safe area to drawer header and drawer footer.
PageNavigationHost also listens on scaling changed event from toplevel to update the child page safe area.

What is the current behavior?

What is the updated/expected behavior with this PR?

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

@avaloniaui-bot
Copy link
Copy Markdown

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

{
base.OnAttachedToVisualTree(e);

CleanUpSubscriptions();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CleanUpSubscriptions() already nulls _topLevel and _insetManager, the next block never runs?. Can verify? If is the case, ScalingChanged is subscribed below but never unsubscribed in the detach path. That causes duplicate callbacks after a detach/reattach to the same live TopLevel, and can also keep the host alive through the old TopLevel. Can we move the ScalingChanged cleanup into CleanUpSubscriptions() or detach it before calling that helper?`

@avaloniaui-bot
Copy link
Copy Markdown

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants