Default to XamlRoot when unable to find focused object #15189
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Default to XamlRoot when unable to find a focused object in DirectKeyEvents
This may not be the most appropriate "fix" for this. Certainly open to criticism and feedback. We are trapping the alt+space key chord on the win32 side and forwarding it to the xaml side. There we try to find a focused object by walking the xaml tree. If we are unable to find a focused object we return false and do nothing. I suspect that the area that has focus that prevents this from working normally is on the win32 side. Since we want to handle the system menu anyway and are explicitly trapping that key combo and forwarding it on I thought this was the best approach. If we cant find a focused object default to the xaml root.
Validation Steps Performed
System menu opens as it should.
Closes #14397