Skip to content

Conversation

@hbatagelo
Copy link

This PR updates the reference app so that the root view of a regular window stays in the topmost view collection instead of being anchored to the view of the main window. This ensures that the FocusTraversalGroup of the root view is a child of the root focus scope rather than a nested scope.

Why does this matter? Because it fixes an issue where focus sometimes switches back and forth indefinitely between two regular windows. Specifically, the issue occurs when switching focus from a root view A to a root view B while B's focus scope is nested in A's focus scope. When the user activates the top-level window with root view B and the focus goes to B, A's View::_scopeFocusChangeListener detects that the focused scope does not match the newly focused view (B) and requests a focus change back to A. However, when A regains focus, B's View::_scopeFocusChangeListener then notices that B is not focused while its scope node is (since it's inside A's scope) and requests a focus change to B, restarting the loop.

@hbatagelo hbatagelo requested a review from mattkae March 10, 2025 20:56
Copy link

@mattkae mattkae left a comment

Choose a reason for hiding this comment

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

That is reasonable to me :)

@mattkae mattkae merged commit 4e6b248 into foundation-plus-framework Mar 11, 2025
1 of 2 checks passed
@mattkae mattkae deleted the ref-app-root-views branch March 11, 2025 12: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.

3 participants