microsoft / microsoft-ui-xaml

WinUI: a modern UI framework with a rich set of controls and styles to build dynamic and high-performing Windows applications.
MIT License
6.38k stars 683 forks source link

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

Open Prochy opened 4 weeks ago

Prochy commented 4 weeks ago

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

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.

codendone commented 3 weeks ago

Maybe related to #10091 ?

Prochy commented 3 weeks ago

Seems to me more related to this https://github.com/microsoft/microsoft-ui-xaml/issues/10009

Didn’t notice this bug while creating mine.