microsoft / microsoft/microsoft-ui-xaml

DesktopAttachedSiteBridge and DesktopPopupSiteBridge don't inherit from DesktopSiteBridge

Open
#10,455 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area-Islands team-Core
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

Describe the bug

DesktopAttachedSiteBridge and DesktopPopupSiteBridge don't inherit from DesktopSiteBridge, causing crashes in Input, which affects flyouts in XAML as it tries to get a DesktopSiteBridge and failing.

Steps to reproduce the bug

Sample code:

Microsoft.UI.Xaml.XamlIsland island = new();

Microsoft.UI.Xaml.Controls.Button but = new() { Content = "Test" };
Microsoft.UI.Xaml.Controls.MenuFlyout flyout = new();
flyout.Items.Add(new Microsoft.UI.Xaml.Controls.MenuFlyoutItem() { Text = "Test 1" });
flyout.Items.Add(new Microsoft.UI.Xaml.Controls.MenuFlyoutItem() { Text = "Test 2" });
flyout.Items.Add(new Microsoft.UI.Xaml.Controls.MenuFlyoutItem() { Text = "Test 3" });
flyout.ShouldConstrainToRootBounds = false;
but.Flyout = flyout;

island.Content = but;

Microsoft.UI.Windowing.AppWindow appWindow = Microsoft.UI.Windowing.AppWindow.Create();
appWindow.Show();

DesktopAttachedSiteBridge siteBridge = DesktopAttachedSiteBridge.CreateFromWindowId(appWindow.Id);
child.Connect(island.ContentIsland);

Clicking on the button while running under a debugger will reveal that it crashes at Microsoft_UI_Input!ContentIsland::Partner::get_TEMP_DesktopSiteBridge

Expected behavior

Both classes should inherit from DesktopSiteBridge.

Screenshots

No response

NuGet package version

Windows App SDK 1.7.0: 1.7.250310001

Packaging type

Packaged (MSIX)

Windows version

Insider Build (xxxxx)

IDE

Visual Studio 2022-preview

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the definitions of DesktopAttachedSiteBridge, DesktopPopupSiteBridge, and DesktopSiteBridge, then reproduce the flyout crash at ContentIsland::Partner::get_TEMP_DesktopSiteBridge using the provided sample. Confirm that both attached and popup bridge types inherit from DesktopSiteBridge and that the sample no longer crashes when interacting with the MenuFlyout.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.