microsoft / microsoft/microsoft-ui-xaml

Window & app require two clicks to close

Open
#10,586 1 comment 0 reactions 0 assignees View on GitHub
area-AppWindow bug team-Core
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

I wondered why I had to click twice on the windows "close" button for the window to close and my app to shut down. I was able to narrow it down to the code below. It looks like it's caused by a `x:Load="False"` element in my `NavigationView`

### Steps to reproduce the bug

Download and run this example project: [test.zip](https://github.com/user-attachments/files/20489165/test.zip)

It essentially just contains this in the `Window`:

```







```

### Expected behavior

App & Window closes on first click on the window close button

### Screenshots

_No response_

### NuGet package version

WinUI 3 - Windows App SDK 1.8 Experimental 1: 1.8.250515001-experimental2

### Windows version

Windows 11 (24H2): Build 26100

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by running the attached test.zip with Windows App SDK 1.8 Experimental 2 and reproduce the two-click close behavior. Inspect the Window, NavigationView, NavigationView.MenuItems, and the TextBlock using x:Load="False"; done means the app and window close on the first click while preserving the reported reproduction.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.