CommunityToolkit / CommunityToolkit/Maui

[BUG] ShowPopupAsync can hang with only the overlay visible when clicking over a SkiaSharp SKGLView

Open
#2,911 0 comments 0 reactions 0 assignees View on GitHub
bug unverified
Dominant language
C#
Stars
2.7k
Forks
500
Avg merge
2d 14h
Merged PRs (30d)
7

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Did you read the "Reporting a bug" section on Contributing file?

- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

### Current Behavior

If the user is clicking in a window that contains a SkiaSharp SKGLView with a render loop while the ShowPopupAsync popup is coming up, its can intermittently hang the application. The overlay is visible, but the content is not and the app is non-responsive.

### Expected Behavior

Calling ShowPopupAsync should show the specified popup and not hang the application even when a Skia Sharp SKGLView with a render loop exists on the page

### Steps To Reproduce

Run this sample application provided on a Windows machine and press the [click me] button on the first page and then keep clicking repeatedly until the popup either displays (its on a short 500ms delay linked to on appearing), or a white overlay appears (without the popup content) and hangs the app. The app attempts to display 4 popups, each 500ms apart. Its usually quite simple to reproduce by just continuously clicking in the same place the [Click me] button was on the first page. If it fails to reproduce, close the second window and try again.

### Link to public reproduction project repository

https://github.com/cjorgens79/MauiMCTPopupIssue/tree/master

### Environment

```markdown
- .NET MAUI CommunityToolkit: 12.2.0
- OS: Windows 11
- .NET MAUI: 9.0.120
- SkiaSharp: 3.119.1
```

### Anything else?

This issue appears to be related to having an SKGLView on the page with RenderLoop=true, perhaps as something is drawing in the background while clicking and the popup trying to display over the top it causes the issue?
Also of note is that setting "CanBeDismissedByTappingOutsideOfPopup = false" also stops it crashing, presumably because its no longer trying to act on those clicks that are occurring while the popup is opening.

Contributor guide

Open the contributing guide

Research direction

Start by running the linked reproduction project on Windows with a SkiaSharp SKGLView using RenderLoop=true, then reproduce the repeated clicks while ShowPopupAsync opens. Compare the behavior with CanBeDismissedByTappingOutsideOfPopup set to false; done means the specified popup reliably appears without the overlay-only hang or an unresponsive app.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
frontend
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.