Skip to content

fix: stop registering powerMonitor for Windows suspend notifications it ignores - #54384

Merged
MarshallOfSound merged 2 commits into
45-x-yfrom
trop/45-x-y-bp-fix-stop-registering-powermonitor-for-windows-suspend-notifications-it-ignores-1790352461169
Sep 25, 2026
Merged

MarshallOfSound merged 2 commits into
45-x-yfrom
trop/45-x-y-bp-fix-stop-registering-powermonitor-for-windows-suspend-notifications-it-ignores-1790352461169

Conversation

@trop

@trop trop Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Backport of #54352

See that PR for details.

Notes: Fixed a possible crash on Windows on ARM when powerMonitor is torn down.

trop Bot and others added 2 commits September 25, 2026 16:07
…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]>
@trop
trop Bot requested a review from MarshallOfSound September 25, 2026 16:08
@trop trop Bot added 45-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Sep 25, 2026
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) September 25, 2026 16:21
@MarshallOfSound
MarshallOfSound merged commit 7946466 into 45-x-y Sep 25, 2026
90 checks passed
@MarshallOfSound
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-clerk

release-clerk Bot commented Sep 25, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed a possible crash on Windows on ARM when powerMonitor is torn down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

45-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant