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: ensure popup and closepopup are threaded correctly #20114

Merged
merged 1 commit into from Sep 5, 2019

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Sep 4, 2019

Description of Change

Fixes #19411.

Previously, we called base::PostTaskWithTraits on menu.popup(), which meant that we would encounter a race condition with menu.closePopup() if it was called too soon after menu.popup(); the window_id would not yet have been added to popup_controllers_ and thus it would not be able to find the menu to close.

This fixes that race condition by posting menu.closePopup() to the current sequence to ensure that the popup task had finished running before other tasks are run.

cc @nornagon @deepak1556

Checklist

Release Notes

Notes: Fixed an issue where menu.closePopup() would have no effect if called too soon after menu.popup().

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Sep 4, 2019
@codebytere codebytere changed the title fix: ensure popup and closepopup are posted in order fix: ensure popup and closepopup are threaded correctly Sep 4, 2019
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Sep 5, 2019
@jkleinsc jkleinsc merged commit 20e3c51 into master Sep 5, 2019
@release-clerk
Copy link

release-clerk bot commented Sep 5, 2019

Release Notes Persisted

Fixed an issue where menu.closePopup() would have no effect if called too soon after menu.popup().

@jkleinsc jkleinsc deleted the fix-menu-popup-threading branch September 5, 2019 20:37
@jkleinsc jkleinsc restored the fix-menu-popup-threading branch September 5, 2019 20:37
@jkleinsc jkleinsc deleted the fix-menu-popup-threading branch September 5, 2019 20:37
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.

closePopup() doesn't close the menu if called immediately after popup()
3 participants