feat: add 'restored-persisted-state' event to BaseWindow
Description of Change
[!NOTE] This PR is part of GSoC 2025 [project] [rfc]. It should be stacked on top of https://github.com/electron/electron/pull/47781 and https://github.com/electron/electron/pull/48048
Adds a new restored-persisted-state event to BaseWindow that emits when window state restoration logic completes during initialization.
The event only fires when windowStatePersistence is enabled, saved window state exists on disk, and valid display exists for window to be restored on.
It uses EmitEventSoon to ensure the event is delivered after the JavaScript object is fully constructed.
Checklist
- [x] PR description included and stakeholders cc'd
- [x]
npm testpasses - [x] tests are changed or added
- [x] relevant API documentation, tutorials, and examples are updated and follow the documentation style guide
- [x] PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
Release Notes
Notes: Added restored-persisted-state event to BaseWindow that emits when the persisted window state is restored.
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
| Diff | Package | Supply Chain Security |
Vulnerability | Quality | Maintenance | License |
|---|---|---|---|---|---|---|
| @electron/typescript-definitions@9.1.2 ⏵ 9.1.5 | ||||||
| @types/node@24.9.1 | ||||||
| @xmldom/xmldom@0.8.11 | ||||||
| @electron/asar@3.2.13 ⏵ 4.0.1 | ||||||
| webpack-cli@5.1.4 ⏵ 6.0.1 | ||||||
| express@4.21.0 ⏵ 4.21.2 | ||||||
| typescript@5.6.2 ⏵ 5.8.3 | ||||||
| mocha@10.4.0 ⏵ 10.8.2 |
+13,877 −7,906
@nilayarya it feels like a wrong branch got selected here somewhere?
I don't think a 22K LOC diff is reviewable. Can you remove the extraneous commits?
@ckerr Sorry for the troubles. This will look right once electron/gsoc-2025 is rebased on main.
@ckerr Sorry for the troubles. This will look right once
electron/gsoc-2025is rebased on main.
No worries! I appreciate the PRs!