Repository navigation
fix: stop registering powerMonitor for Windows suspend notifications it ignores - #54352
Merged
MarshallOfSound merged 2 commits intoSep 25, 2026
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.
…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.
MarshallOfSound
force-pushed
the
refactor/win-power-monitor-session-observer
branch
from
September 25, 2026 10:30
3708efd to
0b3278f
Compare
deepak1556
approved these changes
Sep 25, 2026
deepak1556
left a comment
Member
There was a problem hiding this comment.
We never know why the handle crash happened, but also didn't realize this was an unused registration 🤦♂️
Thanks for catching this!
MarshallOfSound
deleted the
refactor/win-power-monitor-session-observer
branch
September 25, 2026 16:07
|
Release Notes Persisted
|
Contributor
|
I was unable to backport this PR to "44-x-y" cleanly; |
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #54384 |
Contributor
|
@MarshallOfSound has manually backported this PR to "44-x-y", please check out #54408 |
MarshallOfSound
added a commit
that referenced
this pull request
Sep 25, 2026
…it ignores (44-x-y) (#54408) fix: stop registering powerMonitor for Windows suspend notifications it ignores (#54352) * fix: stop registering powerMonitor for Windows suspend notifications it ignores 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. * fix: complete ui::SessionChangeObserver where PowerMonitor is destroyed 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. (cherry picked from commit 98704f6)
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.
Description of Change
#47162 removed the
WM_POWERBROADCASThandling from powerMonitor's private message window (suspend/resume come frombase::PowerMonitor), but theRegisterSuspendResumeNotification()call stayed. It no longer feeds anything, and its unregistration is the ARM64 shutdown crash that #50045, #50878 and #51198 have been chasing.lock-screen/unlock-screenfromui::SessionChangeObserver, which registers WTS notifications on the UI thread's singleton window and filters to the current session, and emit directly from that callback instead of re-posting anUnretainedtask.Checklist
Release Notes
Notes: Fixed a possible crash on Windows on ARM when
powerMonitoris torn down.