kangyu-california / PersistentWindows

fork of http://www.ninjacrab.com/persistent-windows/ with windows 10 update
GNU General Public License v3.0
1.45k stars 50 forks source link

No restore on work monitors with same setup #321

Closed Rassi closed 4 months ago

Rassi commented 6 months ago

Thank you for a great tool which I have used for a long time. I have recently upgraded to Windows 11, but found out I still need PW to restore positions properly. However, switching from home to work setup, restoration does not work some times. I have the same monitor positions and resolutions at home and at work:

I hibernate and resume Windows, and this morning at work none of the positions were restored. These are events:

14-05-2024 08:18:24 PersistentWindows: Restore finished in pass 2 with 0 windows recovered for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
14-05-2024 08:18:23 PersistentWindows: Session opening: reason SessionUnlock
14-05-2024 08:18:15 PersistentWindows: Display settings changed Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
14-05-2024 08:18:11 PersistentWindows: Display settings changed Display_Loc0x0_Res1920x1080
14-05-2024 08:18:06 PersistentWindows: Display settings changed Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
14-05-2024 08:18:03 PersistentWindows: Display settings changed Display_Loc0x0_Res1920x1080
14-05-2024 08:18:03 PersistentWindows: Display settings changed Display_Loc0x0_Res1920x1080
14-05-2024 08:17:52 PersistentWindows: Display settings changed Display_Loc0x0_Res1920x1080
14-05-2024 08:17:49 PersistentWindows: System Resuming
13-05-2024 18:40:05 PersistentWindows: System suspending
13-05-2024 18:40:04 PersistentWindows: Session closing: reason SessionLock
13-05-2024 18:35:11 PersistentWindows: Restore finished in pass 2 with 0 windows recovered for display setting Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440
13-05-2024 18:35:10 PersistentWindows: Start restoring window layout back to 13-05-2024 18:00:37 for display setting Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440
13-05-2024 18:35:10 PersistentWindows: Session opening: reason SessionUnlock
13-05-2024 18:35:03 PersistentWindows: System Resuming
13-05-2024 18:00:52 PersistentWindows: System suspending
13-05-2024 18:00:48 PersistentWindows: Session closing: reason SessionLock

I am running version 5.54.8887.42511.

kangyu-california commented 6 months ago

The PW algorithm to restore window position is very mature now, after more than 3 years of constant improvement.

One strange thing I noticed is that PW tend to malfunction when there is a Windows Update pending to install & restart.

Unless the failure can be reliably reproduced, otherwise I would assume the random failure is caused by some inconsistency bug in Windows APIs,

To workaround the random failure in auto restore, I would suggest doing manual restore from snapshot or restore from disk.

Rassi commented 6 months ago

Thanks for your suggestion. I have just returned from a meeting room where my laptop was connected to an external screen, and after returning to my desk and plugging into the dock and 2 external monitors, the windows were all on the laptop monitor.

I then manually chose Restore windows from disk (last event at 11:11:48), and windows were moved to the correct positions. I didn't experience this with Windows 10, but if this manual restore is necessary every time, I will do that. But it does look like the last manual restore uses a different timestamp (14-05-2024 08:33:52) than the first automatic restore after unlocking (15-05-2024 11:04:29).

15-05-2024 11:11:48 PersistentWindows: Start restoring window layout back to 14-05-2024 08:33:52 for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
15-05-2024 11:11:39 PersistentWindows: Restore finished in pass 2 with 0 windows recovered for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
15-05-2024 11:11:37 PersistentWindows: Start restoring window layout back to 15-05-2024 11:04:29 for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
15-05-2024 11:11:37 PersistentWindows: Session opening: reason SessionUnlock
15-05-2024 11:04:29 PersistentWindows: Restore finished in pass 2 with 3 windows recovered for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
15-05-2024 11:04:24 PersistentWindows: move taskbar to (0, 1392), 2560 x 48
15-05-2024 11:04:23 PersistentWindows: Start restoring window layout back to 15-05-2024 09:25:54 for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
15-05-2024 11:04:23 PersistentWindows: Display settings changed Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
15-05-2024 11:04:22 PersistentWindows: Restart restore for Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
15-05-2024 11:04:22 PersistentWindows: Restore aborted for Display_Loc0x0_Res1920x1080
15-05-2024 11:04:20 PersistentWindows: keep invisible window 1 Reminder(s)
15-05-2024 11:04:20 PersistentWindows: Start restoring window layout back to 15-05-2024 10:40:16 for display setting Display_Loc0x0_Res1920x1080
15-05-2024 11:04:19 PersistentWindows: Session closing: reason SessionLock
15-05-2024 11:03:09 PersistentWindows: Start restoring window layout back to 15-05-2024 10:40:16 for display setting Display_Loc0x0_Res1920x1080
15-05-2024 11:03:08 PersistentWindows: Display settings changed Display_Loc0x0_Res1920x1080
kangyu-california commented 6 months ago

It is true that auto restore and snapshot restore use different time stamp.

For debug purpose, the last auto restore is now renamed as snapshot ` (same key as ~) so that user can redo the last auto restore by restore snapshot ` (or ~) to verify that the data used by last auto restore is not corrupted.

Here is the latest patch PersistentWindows5.54_patch1.zip

You may also try command option -delay_auto_restore 3.0 this helps to resolve potential conflict between PW auto restore and restore by Windows 11.

Rassi commented 6 months ago

I have been running with 5.54_patch1 for the last day, and after working from home yesterday, and arriving at work this morning, windows weren't restored away from laptop screen. Here are events:

17-05-2024 08:19:18 PersistentWindows: Restore finished in pass 5 with 0 windows recovered for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
17-05-2024 08:19:15 PersistentWindows: Restart restore for Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
17-05-2024 08:19:15 PersistentWindows: Restore aborted for Display_Loc0x0_Res1920x1080
17-05-2024 08:19:12 PersistentWindows: Restore halted due to new display setting change Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
17-05-2024 08:19:12 PersistentWindows: Display settings changed Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
17-05-2024 08:19:11 PersistentWindows: Session opening: reason SessionUnlock
17-05-2024 08:18:50 PersistentWindows: Display settings changed Display_Loc0x0_Res1920x1080
17-05-2024 08:18:50 PersistentWindows: Display settings changed Display_Loc0x0_Res1920x1080
17-05-2024 08:18:43 PersistentWindows: System Resuming
16-05-2024 17:43:30 PersistentWindows: System suspending
16-05-2024 17:43:29 PersistentWindows: Session closing: reason SessionLock
16-05-2024 17:19:35 PersistentWindows: Restore finished in pass 2 with 0 windows recovered for display setting Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440
16-05-2024 17:19:34 PersistentWindows: Start restoring window layout back to 16-05-2024 16:26:29 for display setting Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440
16-05-2024 17:19:34 PersistentWindows: Session opening: reason SessionUnlock

But! There were crash events immediately after. Here are the events: persistentwindows_crash_5_54_8901_25945_17_05_2024_08_19_21.txt

Do you want me to keep running with 5.54_patch1? I also haven't enabled -delay_auto_restore 3.0, so can try that if you want.

Thanks for looking into this.

kangyu-california commented 6 months ago

Thanks for the crash report, The crash has been fixed PersistentWindows5.54_patch2.zip

The point of the patch is letting user to verify following assumptions

  1. the random auto restore failure is not caused by capturing corrupted data or buggy algorithm. To verify this point, I put in a debug function to allow user to redo last auto restore by restore snapshot ` (or ~), if the redo succeeds, the assumption is validated.
  2. the random auto restore failure is more likely caused by racing conflict between PW auto restore and Win 11 initiated restore. To verify this, user can try -delay_auto_restore command option.
Rassi commented 6 months ago

After working at the office for some days, I am now at my home setup again, and this morning there were windows not restored to their position from last time I was home.

After the auto restore, I ran Restore windows from disk after around 30 seconds, and then the remaining windows were restored to my second monitor. Doing the manual restore did pop up a new message I haven't seen before saying Switch to another virtual desktop to restore windows image

I also got some notifications about Restore missing process with window title, like this: image

Here are events from this morning:

27-05-2024 07:31:21 PersistentWindows: no qualified position data to restore minimized window "Developer PowerShell for VS 2022"
27-05-2024 07:31:03 PersistentWindows: Restore finished in pass 2 with 9 windows recovered for display setting Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440
27-05-2024 07:31:02 PersistentWindows: keep minimized window 
27-05-2024 07:31:00 PersistentWindows: MoveWindowToDesktop() call failed
27-05-2024 07:30:49 PersistentWindows: MoveWindowToDesktop() call failed
27-05-2024 07:30:47 PersistentWindows: MoveWindowToDesktop() call failed
27-05-2024 07:30:41 PersistentWindows: MoveWindowToDesktop() call failed
27-05-2024 07:30:16 PersistentWindows: MoveWindowToDesktop() call failed
27-05-2024 07:29:56 PersistentWindows: window "Developer PowerShell for VS 2022" is hidden by tidytab
27-05-2024 07:29:56 PersistentWindows: Start restoring window layout back to 16-05-2024 08:01:04 for display setting Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440
27-05-2024 07:29:17 PersistentWindows: Restore finished in pass 2 with 0 windows recovered for display setting Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440
27-05-2024 07:29:16 PersistentWindows: Start restoring window layout back to 23-05-2024 15:05:04 for display setting Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440
27-05-2024 07:29:16 PersistentWindows: Session opening: reason SessionUnlock
27-05-2024 07:20:56 PersistentWindows: Display settings changed Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440
27-05-2024 07:20:53 PersistentWindows: System Resuming
24-05-2024 14:56:08 PersistentWindows: System suspending
24-05-2024 14:56:08 PersistentWindows: Session closing: reason SessionLock

Although now that I re-read your last comment, I'm wondering if I misunderstood and did Restore windows from disk instead of snapshot. Should I try to use Restore snapshot the next time windows are not restored properly?

Rassi commented 6 months ago

Also I don't understand the mention of tidytab. I've googled it, and have never heard of it before, and do not have anything like tidytab installed.

kangyu-california commented 6 months ago

The disk capture of 16-05-2024 08:01:04 contains VirtualDesktop information which may become obsolete since PC reboot, the obsolete data is causing dialog popping out during restore from disk. The Tidytab event log might be caused by stale data as well. Just redo capture to disk to flush out stale data.

My previous post suggested trying snapshot restore because we are more interested to find out why the auto restore with time stamp 23-05-2024 15:05:04 failed. Obviously you did not get the point.

Rassi commented 5 months ago

This morning my browser windows (Firefox) were on my laptop monitor, although I always have them on my main monitor. Around 30 seconds after unlocking and auto restore, I tried running restore snapshot (~), but nothing happened. Curiously the Enter the name of snapshot window opened on the laptop monitor although I have always previously had it open on the main monitor.

I opened event viewer, and ran restore snapshot (~) again, but no events were output.

Lastly I brought out Slack, which is usually on my second external monitor, and it restored on the laptop monitor as well.

I have now added -delay_auto_restore 3.0 and will see if that makes a difference.

31-05-2024 08:23:15 PersistentWindows: no qualified position data to restore minimized window "Slack"
31-05-2024 08:18:14 PersistentWindows: Restore finished in pass 2 with 10 windows recovered for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
31-05-2024 08:18:12 PersistentWindows: Start restoring window layout back to 29-05-2024 15:27:01 for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
31-05-2024 08:18:11 PersistentWindows: Session opening: reason SessionUnlock
31-05-2024 08:18:00 PersistentWindows: Display settings changed Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
31-05-2024 08:17:55 PersistentWindows: Display settings changed Display_Loc0x0_Res1920x1080
31-05-2024 08:17:55 PersistentWindows: Display settings changed Display_Loc0x0_Res1920x1080
31-05-2024 08:17:55 PersistentWindows: Display settings changed Display_Loc0x0_Res1920x1080
31-05-2024 08:17:48 PersistentWindows: System Resuming
30-05-2024 15:32:20 PersistentWindows: System suspending
30-05-2024 15:32:20 PersistentWindows: Session closing: reason SessionLock
Rassi commented 5 months ago

After adding -delay_auto_restore 3.0 I stopped PW, and started it again from Task Scheduler. When it started, it correctly moved my browser windows to my main monitor.

31-05-2024 08:53:58 PersistentWindows: Restore finished in pass 2 with 10 windows recovered for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
31-05-2024 08:53:56 PersistentWindows: Start restoring window layout back to 22-05-2024 11:07:01 for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
31-05-2024 08:53:56 PersistentWindows: auto restore from db
31-05-2024 08:53:55 PersistentWindows: Display config is Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
31-05-2024 08:53:54 PersistentWindows:  5.54.8903.27039; OS version: Microsoft Windows NT 6.2.9200.0; .NET version: 4.0.30319.42000
kangyu-california commented 5 months ago

snapshot ` should work, the ~ key (requiring shift key) does not work quite right. This minor issue is fixed in latest checkin.

BTW, it is amazing you are always able to "walk around" my suggestion, and then find something else to distract the conversation.

Rassi commented 5 months ago

I do apologize if I'm distracting the conversation, that is not my intention. In my last posts I tried restoring snapshot like you suggested. I'm also trying to provide all the information I deem relevant every time I experience issues restoring window positions.

This morning no windows seemed restored, and PW had this event: Restore finished in pass 2 with 0 windows recovered for display setting Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440.

I attempted both snapshot ~ and `, and none resulted in any change or output in event viewer. Unfortunately I'm running on a danish keyboard layout, and both ~ and ` require multiple keys. I tried adding US keyboard layout, but neither ` or ~ resulted in events. I can't find a download for the latest checkin.

kangyu-california commented 5 months ago

Here is another method to verify if the auto-restore failure is indeed caused by PW itself.

Run PW with -prompt_session_restore command option, so that a dialog will pop out before auto-restore happens, this allows user to wait for Windows OS to complete its own restore job first, then proceed with PW auto-restore.

Rassi commented 5 months ago

Today returning to office, a couple of windows were restored automatically, but not all. And restore dialog did not pop up. After trying restore snapshot ` no more windows were restored, but event viewer contained a bunch of events. I have anonymized some of the information.

11-06-2024 08:28:02 PersistentWindows: Restore finished in pass 2 with 2 windows recovered for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Inbox - XXXX@X.X - Outlook
11-06-2024 08:28:02 PersistentWindows: no previous record found for window C:\x\x\src\X.x\bin\Debug\net6.0\X.x.exe
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Microsoft SharePoint
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Downloads
11-06-2024 08:28:02 PersistentWindows: no previous record found for window 1Password Agent
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Hidden Window
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Microsoft Visual Studio
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Process Explorer - Sysinternals: www.sysinternals.com [x\XXXX]
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Microsoft Word
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Outlook Send/Receive Progress
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Hidden Window
11-06-2024 08:28:02 PersistentWindows: no previous record found for window PlacementTargetWindow
11-06-2024 08:28:02 PersistentWindows: no previous record found for window notes.txt - Visual Studio Code
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Restore Session — Mozilla Firefox
11-06-2024 08:28:02 PersistentWindows: no previous record found for window X.x - Microsoft Visual Studio
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Inbox - XXXX@X.X - Outlook
11-06-2024 08:28:02 PersistentWindows: no previous record found for window C:\x\x\src\X.x\bin\Debug\net6.0\X.x.exe
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Microsoft SharePoint
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Downloads
11-06-2024 08:28:02 PersistentWindows: no previous record found for window 1Password Agent
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Hidden Window
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Microsoft Visual Studio
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Process Explorer - Sysinternals: www.sysinternals.com [x\XXXX]
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Microsoft Word
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Outlook Send/Receive Progress
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Hidden Window
11-06-2024 08:28:02 PersistentWindows: no previous record found for window PlacementTargetWindow
11-06-2024 08:28:02 PersistentWindows: no previous record found for window notes.txt - Visual Studio Code
11-06-2024 08:28:02 PersistentWindows: no previous record found for window Restore Session — Mozilla Firefox
11-06-2024 08:28:02 PersistentWindows: no previous record found for window X.x - Microsoft Visual Studio
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Inbox - XXXX@X.X - Outlook
11-06-2024 08:28:01 PersistentWindows: no previous record found for window C:\x\x\src\X.x\bin\Debug\net6.0\X.x.exe
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Microsoft SharePoint
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Downloads
11-06-2024 08:28:01 PersistentWindows: no previous record found for window 1Password Agent
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Hidden Window
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Microsoft Visual Studio
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Process Explorer - Sysinternals: www.sysinternals.com [x\XXXX]
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Microsoft Word
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Outlook Send/Receive Progress
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Hidden Window
11-06-2024 08:28:01 PersistentWindows: no previous record found for window PlacementTargetWindow
11-06-2024 08:28:01 PersistentWindows: Fix topmost window C:\x - PowerShell 5.1 (19560) True
11-06-2024 08:28:01 PersistentWindows: no previous record found for window notes.txt - Visual Studio Code
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Restore Session — Mozilla Firefox
11-06-2024 08:28:01 PersistentWindows: no previous record found for window X.x - Microsoft Visual Studio
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Downloads
11-06-2024 08:28:01 PersistentWindows: no previous record found for window notes.txt - Visual Studio Code
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Restore Session — Mozilla Firefox
11-06-2024 08:28:01 PersistentWindows: no previous record found for window X.x - Microsoft Visual Studio
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Inbox - XXXX@X.X - Outlook
11-06-2024 08:28:01 PersistentWindows: no previous record found for window C:\x\x\src\X.x\bin\Debug\net6.0\X.x.exe
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Microsoft SharePoint
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Downloads
11-06-2024 08:28:01 PersistentWindows: no previous record found for window 1Password Agent
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Hidden Window
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Microsoft Visual Studio
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Process Explorer - Sysinternals: www.sysinternals.com [x\XXXX]
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Microsoft Word
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Outlook Send/Receive Progress
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Hidden Window
11-06-2024 08:28:01 PersistentWindows: no previous record found for window PlacementTargetWindow
11-06-2024 08:28:01 PersistentWindows: no previous record found for window notes.txt - Visual Studio Code
11-06-2024 08:28:01 PersistentWindows: no previous record found for window Restore Session — Mozilla Firefox
11-06-2024 08:28:01 PersistentWindows: no previous record found for window X.x - Microsoft Visual Studio
11-06-2024 08:28:01 PersistentWindows: Start restoring window layout back to 07-06-2024 14:38:40 for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
11-06-2024 08:28:01 PersistentWindows: restore snapshot 36
11-06-2024 08:27:10 PersistentWindows: Restore finished in pass 2 with 2 windows recovered for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
11-06-2024 08:27:09 PersistentWindows: Start restoring window layout back to 07-06-2024 14:38:40 for display setting Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
11-06-2024 08:27:09 PersistentWindows: Restart restore for Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
11-06-2024 08:27:09 PersistentWindows: Restore aborted for Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440
11-06-2024 08:27:05 PersistentWindows: Restore halted due to new display setting change Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
11-06-2024 08:27:05 PersistentWindows: Display settings changed Display_LocM1920xM22_Res1920x1080__Display_Loc0x0_Res2560x1440__Display_Loc2560xM22_Res2560x1440
11-06-2024 08:27:03 PersistentWindows: Session opening: reason SessionUnlock
11-06-2024 08:26:27 PersistentWindows: System Resuming
10-06-2024 15:32:28 PersistentWindows: System suspending

I am starting PW with the following parameters -splash=0 -ignore_process "PanGPA.exe" -webpage_commander_window=0 -delay_auto_restore 3.0 -prompt_session_restore

Rassi commented 5 months ago

In case I was not clear. I have seen the restore dialog popup working. For instance when going to, and returning from meetings with external screens.

kangyu-california commented 5 months ago

It seems the issue is caused by window closed between recent two office visit, i.e. between 07-06-2024 14:38:40 and 11-06-2024 08:26:27 When user closes a window, all the recorded history kept in ram for that window is gone. There is no easy way to let the newly opened window to inherit position record from closed window. Hence the message "no previous record found" This is expected behavior. The workaround for now is to restore from disk.

Thanks for the bug report, I will do more research to see if it is possible to make PW smarter by letting new window to automatically inherit data from closed window.

kangyu-california commented 5 months ago

Auto inheritance of position history from killed window is now supported, please try PersistentWindows5.54_patch5.zip

image

ghost commented 5 months ago

hey I'm new to using Persistent Window and I'm also having a similar issue I downloaded it today and followed all the instructions for 5.54_patch5 on Windows 10 but I noticed when I have programs minimized and the monitors came back from sleep the programs wouldn't be on the same monitor anymore its just randomly on one of the other monitors, I'm really not sure if I'm doing something wrong or if Persistent Windows doesn't support minimized programs as I've noticed if the programs are not minimized they come back were I left them just as Persistent Windows is supposed to work.

kangyu-california commented 5 months ago

@Bannpix It is a known issue that some apps (like Winamp) do not use standard window framework, thus not generating proper message when minimized which is required for PW to keep track of its status. If that is not the case, please create a new issue, and do include more details such as app name, how to reproduce, event log (please check last section of readme home page) etc.

ghost commented 5 months ago

I've gone ahead and made a "new issue"

Rassi commented 5 months ago

The latest 5.54_patch5 has improved this issued a lot. I am happy for you to close this issue as fixed on my end. Thank you for your persistence.

kangyu-california commented 5 months ago

I am glad that the long discussion finally lead to wonderful feature enhancement that was thought to be impossible.

Thanks for your persistence that helps me to realize the user expectation, which is quite difficult to understand in the beginning from programmer's point of view (#326)