microsoft / microsoft/microsoft-ui-xaml

When the WinUI3 window of Windows App SDK 1.6 is launched, it will cause any window with the TOPMOST style of any other process to lose the TOPMOST effect

Open
#9,990 1 comment 10 reactions 1 assignee Claimed by @JesseCol View on GitHub
area-Windowing bug team-CompInput team-Core team-Reach
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

When the `WinUI3 desktop` window is launched, **any window** with the `TOPMOST` style of **any other process** will lose the `TOPMOST` effect, but the `TOPMOST` style does not disappear.

### Steps to reproduce the bug

1. Use Visual Studio 2022 to create a WinUI3 project, the development language is C++.
![Image](https://github.com/user-attachments/assets/ab5284f7-3768-43e3-acff-f12133e798ae)

2. Upgrade the WindowsAppSDK version to 1.6 via Nuget.
![Image](https://github.com/user-attachments/assets/0640c97a-6458-4a05-8ab5-3060bb2bc3ac)

3. When upgrading Windows App SDK, an error is generated, prompting that Visual Studio needs to be restarted, but the upgrade is successful.
![Image](https://github.com/user-attachments/assets/b09eebe0-d52a-4e1b-8b5a-df0f3ffbc37b)

4. After restarting Visual Studio, compile and run the project, the bug reappears.
[HelloWinUI3.zip](https://github.com/user-attachments/files/17349103/HelloWinUI3.zip)

5. For example, if we start procexp and turn on `Options`-`Always On Top`, we can check the window style through spyxx. As shown in the following picture, we can see that the Explorer window has the focus, but the procexp window is TopMost, so the Explorer window can only be behind now.
![image](https://github.com/user-attachments/assets/a244a234-8c34-4e2e-9775-e86c82e9ba2d)

6. Then we start the C++ WinUI3 Deskop window and the bug reappears. As shown in the following picture, click the Explorer window to give it focus, and then the procexp window and the spyxx property window are displayed at the back. If you click them again, the TOPMOST state will be restored.
![image](https://github.com/user-attachments/assets/a5f8d3ff-f78e-47df-9a60-b82bdec4f15b)

### Expected behavior

_No response_

### Screenshots

_No response_

### NuGet package version

WinUI 3 - Windows App SDK 1.6.0: 1.6.240829007
WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002

### Windows version

Windows 11 (22H2): Build 22621
Windows 11 (23H2): Build 22635
Windows 11 (24H2): Build 26100

### IDE

Visual Studio 2022

### Additional context

Downgrading to version 1.5 and clearing all dynamically generated files can be recovered.

I'm not sure if this is a WinUI3 bug or a WindowsAppSDK bug, so I raised issues in both projects.

See also: https://github.com/microsoft/WindowsAppSDK/issues/4801

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.