microsoft / microsoft/microsoft-ui-xaml
XAML Islands: gamepad input while a game is foreground drives focus navigation in a background app's ListView and fail-fasts the process (0xc000027b, E_INVALIDARG from CFocusManager GettingFocus raise)
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
> Affected app: **Windows Terminal** (XAML Islands host of system XAML + WinUI 2.8). Filing here because the fail-fast originates in `Windows.UI.Xaml.dll` focus management and the trigger is gamepad input reaching a **background** XAML Islands app; the host app can at best work around it. (microsoft/terminal currently has interactions restricted, so I could not cross-file there.)
## Windows Terminal version
1.24.11321.0 (app binary 1.24.2605.12001, Store install)
## Windows build number
10.0.26200 (Windows 11 Pro)
## Other Software
- DRAGON QUEST XI S (Steam), running fullscreen-borderless (`FullscreenMode=1`)
- Xbox controller (XInput)
- Terminal is in the background with ordinary shell tabs open (PowerShell); no Settings tab, no flyouts
## Steps to reproduce
1. Have Windows Terminal open with one or more tabs (nothing special — no Settings UI open).
2. Launch a game and play it with an Xbox controller (reproduced repeatedly with Dragon Quest XI S; Terminal is backgrounded the whole time).
3. Press controller buttons / D-pad during normal play.
After some time in-game, WindowsTerminal.exe fail-fasts. Because all windows share one process, **every Terminal window and tab disappears at once**. Reproduced 5 times across 2 weeks (5/30 ×3, 6/2, 6/11), identical crash bucket each time. It has never happened outside of controller play.
## Expected Behavior
Gamepad input while a game is foregrounded should not reach Terminal's XAML chrome, and certainly should not bring down the whole process.
## Actual Behavior
Fail-fast crash, exception `0xc000027b` (stowed exception), faulting module `Windows.UI.Xaml.dll`.
Event Log (Application, Id 1000):
```
Faulting application name: WindowsTerminal.exe, version: 1.24.2605.12001
Faulting module name: Windows.UI.Xaml.dll, version: 10.0.26100.8521
Exception code: 0xc000027b
Fault offset: 0x00000000008fa853
Faulting package full name: Microsoft.WindowsTerminal_1.24.11321.0_x64__8wekyb3d8bbwe
```
`!analyze -v` on the WER LocalDump:
```
FAILURE_BUCKET_ID: STOWED_EXCEPTION_c000027b_Windows.UI.Xaml.dll!DirectUI::ErrorHelper::ProcessUnhandledError
FAULTING_SOURCE_FILE: onecoreuap\windows\dxaml\xcp\dxaml\lib\errorhelper.cpp (line 616)
```
Faulting (UI) thread — a KeyDown is being processed and drives directional focus navigation through a ListView; the GettingFocus/LosingFocus event raise fails with `E_INVALIDARG` (WER inner signature: combase.dll, exception code 80070057) and XAML fail-fasts:
```
KERNELBASE!RaiseFailFastException
combase!RoFailFastWithErrorContextInternal2
Windows_UI_Xaml!DirectUI::ErrorHelper::ProcessUnhandledError
Windows_UI_Xaml!DirectUI::ErrorHelper::ReportUnhandledError
...
Windows_UI_Xaml!CFocusManager::RaiseChangingFocusEvent
Windows_UI_Xaml!CFocusManager::RaiseAndProcessGettingAndLosingFocusEvents
Windows_UI_Xaml!CFocusManager::UpdateFocus
Windows_UI_Xaml!CUIElement::Focus
Windows_UI_Xaml!DirectUI::FocusManagerFactory::SetFocusedElementWithDirectionImpl
...
Windows_UI_Xaml!DirectUI::SelectorItem::FocusSelfOrChild
Windows_UI_Xaml!DirectUI::Selector::SetFocusedItem
Windows_UI_Xaml!DirectUI::ListViewBase::SetFocusedItem
Windows_UI_Xaml!DirectUI::ListViewBase::OnKeyDown
Microsoft_UI_Xaml!winrt::impl::consume_Windows_UI_Xaml_Controls_IControlOverrides<...>::OnKeyDown
Microsoft_UI_Xaml!winrt::Windows::UI::Xaml::Controls::IControlOverridesT::OnKeyDown <-- likely ICF-folded thunk; no ColorPicker UI was open. The ListViewBase is presumably the TabView's TabViewListView (tab row).
Microsoft_UI_Xaml!winrt::impl::produce::OnKeyDown
Windows_UI_Xaml!DirectUI::ControlGenerated::OnKeyDownProtected
Windows_UI_Xaml!DirectUI::Control::FireEvent
...
Windows_UI_Xaml!CEventManager::RaiseRoutedEvent
Windows_UI_Xaml!ContentRootInput::KeyboardInputProcessor::ProcessXCPKeydown
```
Notes that may help triage:
- The key event reaches XAML while the game is the foreground window — gamepad-to-XAML key synthesis appears not to be focus-gated for the islands host, and the resulting directional focus move inside the (always-present) tab-row ListView is what dies.
- `Windows.Gaming.Input.dll` / `GameInput.dll` are **not** in the dump's loaded-module list; the input is arriving via `InputHost.dll`/CoreMessaging.
- All 5 crashes have the same hashed bucket `3d6dd0421a34f92c59a55f0c5ff99fa2`; WER fault bucket `1847987728859897762`, latest Report Id `36878e63-fe81-42c2-bc93-95325f3361d2` (uploaded, Watson should have the cab). I also have local 32 MB heap dumps for all 5 occurrences and can share privately on request.
Contributor guide
Research direction
Begin with the supplied Windows Terminal reproduction and WER dump; inspect the listed CFocusManager/ListViewBase focus path and InputHost/CoreMessaging input path. No repository file or test is named, so first locate the relevant XAML focus and keyboard-input code. Done means reproducing the background-gamepad case and preventing the fail-fast without disrupting foreground input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, frontend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100