Skip to content

Fix Toplevel not losing focus with native implementation deactivates.#20768

Merged
MrJul merged 2 commits intomasterfrom
toplevel_focus_lost_fix
Feb 26, 2026
Merged

Fix Toplevel not losing focus with native implementation deactivates.#20768
MrJul merged 2 commits intomasterfrom
toplevel_focus_lost_fix

Conversation

@emmauss
Copy link
Contributor

@emmauss emmauss commented Feb 26, 2026

What does the pull request do?

#20732 added PresentationSource and made that the visual root. This broke focus logic in Toplevel, where a check if the current visual root is the toplevel is done before focus lost is processed. This is because Toplevel was previously the visual root.
This PR instead directly gets the toplevel from the focused element and does that check on that, instead of looping to find the visual root.

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

Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

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

LGTM!

@MrJul MrJul enabled auto-merge February 26, 2026 19:34
@avaloniaui-bot
Copy link

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

@MrJul MrJul added this pull request to the merge queue Feb 26, 2026
Merged via the queue into master with commit d22683f Feb 26, 2026
11 of 12 checks passed
@MrJul MrJul deleted the toplevel_focus_lost_fix branch February 26, 2026 21:58
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.

3 participants