microsoft / microsoft/microsoft-ui-xaml

Not possible to focus to a new activated window while being focused outside of VM (Hyper-V)

Open
#10,124 2 comments 0 reactions 0 assignees View on GitHub
area-Windowing bug Regression team-CompInput
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

When testing my app in Hyper-V, if I switch focus outside of Hyper-V and a new window activates in the meantime, I’m unable to focus on the new window and click the button.

https://github.com/user-attachments/assets/e7d2bec7-3b64-4c0a-9468-b65d208440ab

### Steps to reproduce the bug

1. I compiled with: dotnet publish -p:Configuration=Debug --self-contained true -p:RuntimeIdentifier=win-x64 -p:Platform=x64 -p:WindowsAppSDKSelfContained=true --output Publish
2. Run App8.exe inside Hyper-V
3. Switch focus outside VM
4. Wait 5 seconds till new window is activated.

[FocusBug.zip](https://github.com/user-attachments/files/17576883/FocusBug.zip)

### Expected behavior

It’s possible to focus on the new window and click the button.

### Screenshots

_No response_

### NuGet package version

Windows App SDK 1.6.1: 1.6.240923002

### Packaging type

Unpackaged

### Windows version

Windows 11 version 22H2 (22621, 2022 Update)

### IDE

Visual Studio 2022

### Additional context

If I click at the window and then I press any key, it starts working again. **Looks like it's related to 1.6, I'm not able to replicate it with "1.5.240607001" and "10.0.26100.1" version.**

Contributor guide

Open the contributing guide

Research direction

Start by running the provided FocusBug.zip reproduction in Hyper-V with Windows App SDK 1.6.1, then compare its focus behavior with the listed 1.5 and 10.0.26100.1 versions. No source file or test is named; done means identifying the regression and restoring the ability to focus and click the newly activated window while focus is outside the VM.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.