Repository navigation
fix: stop registering powerMonitor for Windows suspend notifications it ignores - #54384
Merged
Conversation
…it ignores #47162 removed the WM_POWERBROADCAST handling from powerMonitor's message window (suspend/resume come from base::PowerMonitor), but left the RegisterSuspendResumeNotification() call behind. That registration no longer fed anything and its unregistration is the ARM64 shutdown crash that #50045, #50878 and #51198 have been chasing. Drop the private message window entirely and take session lock/unlock from ui::SessionChangeObserver, which registers WTS notifications on the UI thread's singleton window and already filters to the current session. Co-authored-by: Sam Attard <[email protected]>
…ed and emit directly ~PowerMonitor() is defined in electron_api_power_monitor.cc, which only saw the forward declaration, so the unique_ptr member did not compile on Windows. The session change callback already runs on the UI thread, so emit there instead of posting an Unretained task that nothing can cancel. Co-authored-by: Sam Attard <[email protected]>
3 tasks done
MarshallOfSound
approved these changes
Sep 25, 2026
MarshallOfSound
enabled auto-merge (squash)
September 25, 2026 16:21
MarshallOfSound
deleted the
trop/45-x-y-bp-fix-stop-registering-powermonitor-for-windows-suspend-notifications-it-ignores-1790352461169
branch
September 25, 2026 18:37
|
Release Notes Persisted
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #54352
See that PR for details.
Notes: Fixed a possible crash on Windows on ARM when
powerMonitoris torn down.