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

Default to XamlRoot when unable to find focused object #15189

Merged
merged 2 commits into from
Apr 20, 2023

Conversation

jamespack
Copy link
Contributor

@jamespack jamespack commented Apr 15, 2023

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

@microsoft-github-policy-service microsoft-github-policy-service bot added Issue-Bug It either shouldn't be doing this or needs an investigation. Area-Settings UI Anything specific to the SUI Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Apr 15, 2023
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

@zadjii-msft will you be the third on this? Since it touches some of the xaml bits you've been working with :)

@zadjii-msft zadjii-msft merged commit 210414e into microsoft:main Apr 20, 2023
DHowett pushed a commit that referenced this pull request Apr 25, 2023
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.

System menu opens as it should.

Closes #14397

(cherry picked from commit 210414e)
Service-Card-Id: 89001997
Service-Version: 1.17
DHowett pushed a commit that referenced this pull request May 11, 2023
DHowett pushed a commit that referenced this pull request May 15, 2023
As discussed in
#14051 (comment)

regressed in #15189

(cherry picked from commit 0553f3e)
Service-Card-Id: 89031966
Service-Version: 1.17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings UI Anything specific to the SUI Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alt-Space suppressed when Settings is the only tab
4 participants