Skip to content
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

Closing a TopLevel causes Render to happen out of sequence (MediaContext issue) #17784

Open
danwalmsley opened this issue Dec 16, 2024 · 0 comments
Assignees
Labels

Comments

@danwalmsley
Copy link
Member

Describe the bug

The a toplevel closes i.e. from combobox or popup etc

HandleClosed is called, causing MediaContext SyncCommit, which triggers a full render pass for all TopLevels.

This Render pass is called without a layout pass, so you can be rendering invalid state.

To Reproduce

  1. Checkout the branch repros/text-alignment-issue

  2. select an option from the combobox, and see the textlblock on the page change (but be left aligned) It should be right aligned.

  3. resize the window to trigger a layout pass, and notice the text alignment corrects itself.

  4. place a breakpoint in TopLevel.HandleClosed and repeat
    see that this is called and note the comment
    SyncDisposeCompositionTarget

// TODO: introduce a way to skip any actual rendering for other targets and only do a dispose?

so render gets called, but we only need to dispose.

Expected behavior

The text alignment should not change, render should not be called on the textblock

Media context should "have a way to notify the compositor about dispose and wait for the current frame and dispose to finish"

Avalonia version

11.2.x

OS

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants