I probably should know the answer to this but I don't, so I'll ask.
When I enable state restoration and have like three windows open, and I quit the app (via Quit menu, not 'Stop In Xcode') the following happens:
-NSApplication calls _closeForTermination on all the windows and this causes state restoration to fail to restore these open windows on next app launch.
This behavior is not aligned with the behavior of apps like Mail. If I have two "Viewer Windows" open in Mail and I quit the app, when I relaunch the two viewer windows are restored.
I can of course track this and write data to restore for these auto closed window myself but shouldn't there be an easy way to opt in to this behavior?