[PR #15189] [MERGED] Default to XamlRoot when unable to find focused object #30479

Open
opened 2026-01-31 09:41:04 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/15189
Author: @jamespack
Created: 4/16/2023
Status: Merged
Merged: 4/20/2023
Merged by: @zadjii-msft

Base: mainHead: terminal-14397


📝 Commits (2)

  • 0334c95 Default to XamlRoot when unable to find focused object in OnDirectKeyEvent
  • 74a7682 run code format

📊 Changes

1 file changed (+7 additions, -0 deletions)

View changed files

📝 src/cascadia/TerminalApp/TerminalWindow.cpp (+7 -0)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/15189 **Author:** [@jamespack](https://github.com/jamespack) **Created:** 4/16/2023 **Status:** ✅ Merged **Merged:** 4/20/2023 **Merged by:** [@zadjii-msft](https://github.com/zadjii-msft) **Base:** `main` ← **Head:** `terminal-14397` --- ### 📝 Commits (2) - [`0334c95`](https://github.com/microsoft/terminal/commit/0334c9549c67ed450712e22b8f7b373486c0cf2b) Default to XamlRoot when unable to find focused object in OnDirectKeyEvent - [`74a7682`](https://github.com/microsoft/terminal/commit/74a768270a1a4481dabadd4d171cf25af4ecda5f) run code format ### 📊 Changes **1 file changed** (+7 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/TerminalWindow.cpp` (+7 -0) </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:41:04 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30479