Skip to content

fix(XamlRoot): Changed event incorrect Size value on device rotation #20472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Xiaoy312
Copy link
Contributor

GitHub Issue (If applicable): closes unoplatform/uno-private#1267

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

XamlRoot.Changed is fired, before its .Size is updated on device rotation.

What is the new behavior?

XamlRoot.Size origin updates will now in turn trigger a XamlRoot.Changed.

PR Checklist

Please check if your PR fulfills the following requirements:

@Xiaoy312 Xiaoy312 enabled auto-merge May 20, 2025 18:28
@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-20472/docs/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-20472/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 166226 has failed on Uno.UI - CI.

{
add
{
if (RootElement is FrameworkElement fe)
Copy link
Member

@MartinZikmund MartinZikmund May 21, 2025

Choose a reason for hiding this comment

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

This seems odd 🤔 - the screen size should directly affect XamlRoot, so size changes should not have to depend on the root element. I would prefer to avoid this due to the fact that this part of the source should be aligned with WinUI which does not require this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem is what would be the alternative/proper solution...
Right now, the XamlRoot.Size just routes to the VisualTree. But, VisualTree.Size changes are not raised back to XamlRoot.

Copy link
Member

Choose a reason for hiding this comment

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

Can you please provide me a scenario of when there is a VisualTree.Size change which does not come from XamlRoot so I can repro it locally? I think that such a situation should mean the routing of the source of the event should go through a different path instead in such case and there is a bug in the current sizing handling instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gave you the repro, any update on this?

@MartinZikmund MartinZikmund requested a review from ajpinedam May 22, 2025 16:38
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.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy