Skip to content

fix(macOS): Avoid reentrant runModal in file pickers - #23117

Merged
ajpinedam merged 3 commits into
unoplatform:masterfrom
ajpinedam:dev/anpi/fix.macos.pickmultiplefyleasync.crash
May 6, 2026
Merged

ajpinedam merged 3 commits into
unoplatform:masterfrom
ajpinedam:dev/anpi/fix.macos.pickmultiplefyleasync.crash

Conversation

@ajpinedam

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #23071

PR Type:

  • 🐞 Bugfix

What is the current behavior? 🤔

What is the new behavior? 🚀

PR Checklist ✅

Please check if your PR fulfills the following requirements:

Other information ℹ️

@ajpinedam
ajpinedam requested a review from MartinZikmund April 22, 2026 21:17
@ajpinedam ajpinedam self-assigned this Apr 22, 2026
Copilot AI review requested due to automatic review settings April 22, 2026 21:17
@github-actions github-actions Bot added the platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform label Apr 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Skia macOS picker implementations to avoid calling NSOpenPanel.runModal / NSSavePanel.runModal reentrantly from within pointer/click handling, which can crash input processing and corrupt native return state.

Changes:

  • Always dispatch file/folder/save picker native runModal calls via NativeDispatcher.Main.Enqueue (even when already on the main thread).
  • Normalize the async pattern across macOS picker extensions using TaskCompletionSource + cancellation registration.
  • Add inline rationale/comments referencing the reentrancy crash scenario.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Uno.UI.Runtime.Skia.MacOS/Storage/Pickers/MacOSFileOpenPickerExtension.cs Always enqueues native open-panel calls (single + multiple) to avoid reentrant runModal during pointer handling.
src/Uno.UI.Runtime.Skia.MacOS/Storage/Pickers/MacOSFileSavePickerExtension.cs Always enqueues native save-panel call to avoid reentrant runModal during pointer handling.
src/Uno.UI.Runtime.Skia.MacOS/Storage/Pickers/MacOSFolderPickerExtension.cs Always enqueues native folder-picker open-panel call to avoid reentrant runModal during pointer handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 208755 has failed on Uno.UI - CI.

@ajpinedam
ajpinedam force-pushed the dev/anpi/fix.macos.pickmultiplefyleasync.crash branch from 19ec8ed to 5bd72f7 Compare April 27, 2026 06:02
Copilot AI review requested due to automatic review settings April 27, 2026 06:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops

Copy link
Copy Markdown
Contributor

@ajpinedam
ajpinedam marked this pull request as ready for review April 27, 2026 13:22
Copilot AI review requested due to automatic review settings April 27, 2026 13:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops

Copy link
Copy Markdown
Contributor

@MartinZikmund

Copy link
Copy Markdown
Member

@morning4coffe-dev can you validate and approve please?

@ajpinedam

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@unodevops

Copy link
Copy Markdown
Contributor

@ajpinedam
ajpinedam merged commit 2ab46ad into unoplatform:master May 6, 2026
66 of 67 checks passed
@ajpinedam
ajpinedam deleted the dev/anpi/fix.macos.pickmultiplefyleasync.crash branch May 6, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Skia macOS] PickMultipleFilesAsync crashes with AccessViolationException on cancel

5 participants