Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use nested run loop in clipboard.readImage #39466

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

zcbenz
Copy link
Member

@zcbenz zcbenz commented Aug 11, 2023

Description of Change

Refs #39069.
Closes #39446.

Must explicitly specify kNestableTasksAllowed to make nested run loop work.

Note that this is totally valid trick, there are a few examples can be found in Chromium:
https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:components/printing/renderer/print_render_frame_helper.cc;l=2607;drc=b86abfa407f3f35d3e5904e76b9a8d3a741bdc8b
https://source.chromium.org/chromium/chromium/src/+/main:components/ui_devtools/agent_util.cc;l=38;drc=8ba1bad80dc22235693a0dd41fe55c0fd2dbdabd

/cc @codebytere @TomaszMa

Release Notes

Notes: Fix clipboard.readImage() getting blocked when there is no PNG image in the clipboard.

@zcbenz zcbenz added semver/patch backwards-compatible bug fixes target/26-x-y PR should also be added to the "26-x-y" branch. labels Aug 11, 2023
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Aug 11, 2023
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Aug 12, 2023
@codebytere
Copy link
Member

webContents module loadURL() promise API resolves after browser initiated navigation

is a known failure from #39260 since reverted

@codebytere codebytere merged commit cf658b7 into main Aug 14, 2023
15 of 16 checks passed
@codebytere codebytere deleted the clipboard-readimage-nested-loop branch August 14, 2023 08:35
@release-clerk
Copy link

release-clerk bot commented Aug 14, 2023

Release Notes Persisted

Fix clipboard.readImage() getting blocked when there is no PNG image in the clipboard.

@trop
Copy link
Contributor

trop bot commented Aug 14, 2023

I have automatically backported this PR to "26-x-y", please check out #39487

@trop trop bot added in-flight/26-x-y merged/26-x-y PR was merged to the "26-x-y" branch. and removed target/26-x-y PR should also be added to the "26-x-y" branch. in-flight/26-x-y labels Aug 14, 2023
win32ss pushed a commit to win32ss/supermium-electron that referenced this pull request Sep 24, 2023
MrHuangJser pushed a commit to MrHuangJser/electron that referenced this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/26-x-y PR was merged to the "26-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants