Skip to content

Fix: Do not block main process for async dialog#12404

Merged
codebytere merged 1 commit into
electron:masterfrom
sethlu:non-blocking-dialog-with-callback
Mar 22, 2018
Merged

Fix: Do not block main process for async dialog#12404
codebytere merged 1 commit into
electron:masterfrom
sethlu:non-blocking-dialog-with-callback

Conversation

@sethlu

@sethlu sethlu commented Mar 22, 2018

Copy link
Copy Markdown
Contributor

Reported in #12368: Although the current API seems async electron.dialog.show{Open,Save}Dialog() with callback provided, it runs on a blocking call to macOS AppKit.

Doc ref:

If a callback is passed, the API call will be asynchronous and the result will be passed via callback(filenames).

@sethlu sethlu requested a review from a team March 22, 2018 07:05
@sethlu sethlu changed the title [WIP] Fix: Do not block main process for async dialog Fix: Do not block main process for async dialog Mar 22, 2018
@trop

trop Bot commented Mar 22, 2018

Copy link
Copy Markdown
Contributor

An error occurred while attempting to backport this PR to "1-8-x", you will need to perform this backport manually

@trop

trop Bot commented Mar 22, 2018

Copy link
Copy Markdown
Contributor

An error occurred while attempting to backport this PR to "2-0-x", you will need to perform this backport manually

@MarshallOfSound

Copy link
Copy Markdown
Member

/trop run backport

@trop

trop Bot commented Mar 22, 2018

Copy link
Copy Markdown
Contributor

The backport process for this PR has been manually initiated, here we go! :D

@trop

trop Bot commented Mar 22, 2018

Copy link
Copy Markdown
Contributor

An error occurred while attempting to backport this PR to "1-8-x", you will need to perform this backport manually

@trop

trop Bot commented Mar 22, 2018

Copy link
Copy Markdown
Contributor

We have automatically backported this PR to "2-0-x", please check out #12407

@trop trop Bot added merged/2-0-x and removed target/2-0-x labels Mar 22, 2018
@sethlu

sethlu commented Mar 22, 2018

Copy link
Copy Markdown
Contributor Author

@MarshallOfSound should I manually open a PR to 1-8-x?

@codebytere

Copy link
Copy Markdown
Member

@sethlu that'd be great, thanks!

sethlu added a commit to sethlu/electron that referenced this pull request Mar 26, 2018
@YurySolovyov

Copy link
Copy Markdown
Contributor

Is it possible to test this?

@sethlu

sethlu commented Mar 28, 2018

Copy link
Copy Markdown
Contributor Author

@YurySolovyov the original issue provides a test case for this.

ckerr pushed a commit that referenced this pull request Mar 28, 2018
* Do not block main process for async dialog

Backport #12404

* Reduce code redundancy
sethlu added a commit to sethlu/electron that referenced this pull request May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants