I have the same issue with window positions not restoring after sleep. I recently learned that the problem doesn't appear for any applications which were hidden when your computer sleeps. So I wrote an application to take advantage of this. You can download the application here (free).
I call the application Sandman because it puts it's children to sleep. Unzip and run the application. It should put itself into the background and operate quietly. All it does is listen out for wake & sleep notifications from the computer and the screens, and simply hides and shows applications at appropriate times.
It may not work for everyone. To understand more, there are two main scenarios:
Limitations:
- Your computer sleeps before your monitors do. This is my setup, so this is the most tested scenario. The program works flawlessly for me with two monitors on a Mac Studio (Monterey 12.4).
- Your monitors sleep before your computer sleeps. This scenario is less tested.
Hopefully this helps others.
- Sandman will not work if System Preferences is the active (front) application when sleeping. This is intentional, and it is to avoid issues when you are rearranging your screens in the Displays preference pane.
- Sandman does not work when you log out or restart. It only works for sleep.
Firstly I've created a brief web page so that there is always a single place you can get the latest version. It is here. Right now the latest version is 0.1.2.
Also the program wasn't working so well for some computer and display configurations. So I've modified the program to show a button in a single window when your computer wakes. This isn't as elegant, but more universal. Simply click the button to complete the restoration.
If the previous version works well for you by all means continue to use it. Alternatively there is now an 'auto restore' menu item which will operate as per the previous version (no button to click). No harm trying it, but it will only work for some displays.