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: duplicate suspend/resume events #24818

Merged
merged 1 commit into from Aug 5, 2020
Merged

fix: duplicate suspend/resume events #24818

merged 1 commit into from Aug 5, 2020

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Aug 3, 2020

Description of Change

Closes #24803.

Switches to use NSDistributedNotificationCenter, as using [[[NSWorkspace sharedWorkspace] notificationCenter] cause the events to be emitted twice.

Before:

Screen Shot 2020-08-03 at 11 58 04 AM

After:

Screen Shot 2020-08-03 at 11 57 47 AM

Tested with https://gist.github.com/e498427e185c11ac5d81e3bd0fb6dc72

Checklist

Release Notes

Notes: Fixed an issue where suspend/resume were emitted twice on macOS.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Aug 3, 2020
Copy link
Member

@nornagon nornagon left a comment

Choose a reason for hiding this comment

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

weird, but ok

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Aug 4, 2020
@codebytere codebytere merged commit 06c47c6 into master Aug 5, 2020
@release-clerk
Copy link

release-clerk bot commented Aug 5, 2020

Release Notes Persisted

Fixed an issue where suspend/resume were emitted twice on macOS.

@trop
Copy link
Contributor

trop bot commented Aug 5, 2020

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

@trop
Copy link
Contributor

trop bot commented Aug 5, 2020

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

@trop
Copy link
Contributor

trop bot commented Aug 5, 2020

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

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.

PowerMonitor "resume" and "suspend" event send twice on macOS
3 participants