Maui icon indicating copy to clipboard operation
Maui copied to clipboard

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

Open cjorgens79 opened this issue 2 months ago • 0 comments

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

- .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.

cjorgens79 avatar Oct 22 '25 12:10 cjorgens79