electron icon indicating copy to clipboard operation
electron copied to clipboard

feat: add 'restored-persisted-state' event to BaseWindow

Open nilayarya opened this issue 6 months ago • 3 comments

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

Release Notes

Notes: Added restored-persisted-state event to BaseWindow that emits when the persisted window state is restored.

nilayarya avatar Aug 14 '25 05:08 nilayarya

+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.

nilayarya avatar Nov 25 '25 23:11 nilayarya

@ckerr Sorry for the troubles. This will look right once electron/gsoc-2025 is rebased on main.

No worries! I appreciate the PRs!

ckerr avatar Nov 26 '25 04:11 ckerr