microsoft / microsoft/microsoft-ui-xaml

MenuFlyout doesn't respond to mouse (hover and click) on first open when running as RemoteApp over RDP

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

Description

### Describe the bug

When a WinUI3 application is running as a Remote Desktop RemoteApp, a MenuFlyout will not respond to mouse events (click and hover) the first time it is shown. Once the flyout has been hidden and shown again it behaves as expected.

### Steps to reproduce the bug

1. Compile the attached application and set it up as a RemoteApp on an instance of Windows Server.
2. From another computer, run the RemoteApp over RDP
* https://learn.microsoft.com/en-us/azure/virtual-desktop/rdp-properties#remoteapp
* RDP file contains something like this:
```
redirectclipboard:i:1
redirectprinters:i:1
redirectcomports:i:0
redirectsmartcards:i:1
devicestoredirect:s:*
drivestoredirect:s:*
redirectdrives:i:1
session bpp:i:32
prompt for credentials on client:i:1
span monitors:i:1
use multimon:i:1
remoteapplicationmode:i:1
server port:i:3389
allow font smoothing:i:1
promptcredentialonce:i:0
videoplaybackmode:i:1
audiocapturemode:i:1
gatewayusagemethod:i:0
gatewayprofileusagemethod:i:1
gatewaycredentialssource:i:0
full address:s:TARGET.SERVER.HOST
alternate shell:s:||WinUIUnpackaged
remoteapplicationprogram:s:||WinUIUnpackaged
remoteapplicationname:s:WinUIUnpackaged
remoteapplicationcmdline:s:
workspace id:s:TARGET.SERVER.HOST
use redirection server name:i:1
```
4. Click the button and mouse over the shown MenuFlyout. Notice that the items do not highlight on hover, and do not respond to clicks.
5. Click outside the button to hide the flyout.
6. Click the button again and mouse over the shown MenuFlyout. The items will now highlight when hovered, and add lines to the textblock when clicked. This is the expected behavior, however it should behave this way when shown the first time in step 4.
[WinUIUnpackaged.zip](https://github.com/user-attachments/files/19540822/WinUIUnpackaged.zip)

### Expected behavior

The expected behavior is that the MenuFlyout will respond to mouse hover and click every time it is shown, not just the second and later times.

### Screenshots

![Image](https://github.com/user-attachments/assets/aad0130f-f176-4712-9753-79a62dbc3af6)

### NuGet package version

WinUI 3 - Windows App SDK 1.7.0: 1.7.250310001

### Windows version

Windows 11 (24H2): Build 26100

### Additional context

The server hosting the RemoteApp is Windows Server 2019 Standard, version 1809, build 17763.7009

Contributor guide

Open the contributing guide

Research direction

Start by compiling the attached WinUIUnpackaged.zip application and reproducing the first and second MenuFlyout openings through RemoteApp over RDP. Compare mouse hover and click behavior on each opening, using the reported Windows Server 2019 and Windows 11 environments. Done means the flyout highlights and accepts clicks on its first display as well as later displays.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.