kangyu-california / PersistentWindows

fork of http://www.ninjacrab.com/persistent-windows/ with windows 10 update

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows not restored automatically

mateuszkozakiewicz opened this issue · comments

Hello,

my problem is windows are not restored automatically on wake/screen disconnected on PW > 5.43 (found suggestion to roll back to this version in another issue).
Most notorious apps not restored are Spotify and VSCode - they always land on the main monitor (out of 3 in total).
PW seems to get confused on both sleep/wake and monitor configuration changed.

Rolling back to PW 5.43 fixes all issues.
On PW > 5.43 double clicking tray icon to save window configuration and then clicking once also works, its just not automatic like on 5.43.
My config:
-fix_offscreen_window=0 -splash=0 -delay_auto_capture=3 -delay_auto_restore=3 -check_upgrade=0 -auto_upgrade=0 -foreground_background_dual_position=0
Windows 11

PersistentWindows: avoid restore unresponsive window Setup - Microsoft Visual Studio Code (User)

Can't find anything for Spotify specifically but I get lots of these:

PersistentWindows: avoid restore unresponsive window Setup
PersistentWindows: Restore aborted for Display_LocM2560x0_Res2560x1440__Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440
PersistentWindows: Restore aborted for Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440

The "avoid restore unresponsive window" feature was introduced in 5.31
The unresponsiveness check is enhanced with more restriction. Please try
PersistentWindows5.48_patch276.zip

It seems to have eliminated the error in the logs but today I found the two windows in question minimized (even though they were maximized when the PC was put to sleep) and maximizing landed them on the main display again.
All logs from today:

PersistentWindows: Restore aborted for Display_LocM2560x0_Res2560x1440__Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440
PersistentWindows: restore minimized window "Menu"

The restriction on unresponsive window is further relaxed in https://github.com/kangyu-california/PersistentWindows/releases/tag/5.49

Still trying to reproduce maximized window restored to wrong screen

Spotify still keeps jumping to the wrong screen when monitors wake from sleep (PC was not asleep)
All I see in logs is this

PersistentWindows: Restore aborted for Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440

To help me debug the issue, please run PW with command option -debug_process "Spotify",
Once the issue is reproduced, launch event viewer, select Application
image
Click "Filter current log" in the Action panel on right hand side, choose all 9990,9999 events in last hour
image
Click "Save Selected Events"
Close event viewer or take "Clear Filter" action
Reply the thread by Pasting the saved events file.

With -fix_offscreen_window=0 -splash=0 -delay_auto_capture=3 -delay_auto_restore=3 -check_upgrade=0 -auto_upgrade=0 -foreground_background_dual_position=0 -debug_process "Spotify"
There is still only this log message:

The description for Event ID 9999 from source Application cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

PersistentWindows: Restore aborted for Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440


The message resource is present but the message was not found in the message table

events.zip

It is very unlikely "Restore aborted" is the only message PW print out.
Are you afraid of leaking out privacy when asked to provide complete event report?
Without complete event report I can not help.

How would I prepare one? This is all that's being logged.
Edit: sorry my bad, it seems I only included one of the necessary IDs in event viewer, here is the complete stuff, look at logs from 10h ago (broken) vs right now which worked fine
events.zip

made two related commits, pls try latest 5.49 pre-release
I am expecting to see the following message between start and finish restore
image

Hello, there is no change, again found VSCode and Spotify on my main monitor, while for example Windows Terminal windows which was on the same monitor has not moved.
events.zip

The "avoid restore unresponsive window" feature was introduced in 5.31 The unresponsiveness check is enhanced with more restriction. Please try PersistentWindows5.48_patch276.zip

Hi I downgraded to 5.48 and still spotify app is not working when i Click it, PLEASE HELP

From my side I downgraded to previous AMD driver (23.11.1) and it has improved the situation significantly, I'm still testing because I haven't found any reliable way to reproduce the issue.

From my side I downgraded to previous AMD driver (23.11.1) and it has improved the situation significantly, I'm still testing because I haven't found any reliable way to reproduce the issue.

Thank you for ur fast reply I really appreciate it, one last question, if you downgrade the app, like how did we uninstall it properly? like what I did earlier is I opened the file location and deleted the folder contains the app the 5.48.

IS that the right way to uninstall it?

Thank you

@Daksnapogi To uninstall PW, just delete the unzipped folder. If you want to erase the disk captures as well, just delete C:\Users[User]\AppData\Local\PersistentWindows.

@matti-kz You may also keep current AMD driver and just upgrade to latest patch at https://github.com/kangyu-california/PersistentWindows/releases/tag/5.49_patch

I was testing for a while but it seems to be happening still
events.zip
again Spotify & VSCode

Your event log seems to be valid, but I am unable to reproduce
Just made 5.50 pre-release, which is my best bet.

In case PW fails to restore again, please use snapshot or restore from disk as a workaround until more users demand for fix.

Hi kangyu Id like to ask what is the proper update of any version should we uninstall the app and reinstall the new update? or this will automatically DWNLED ?

Thanks

@Daksnapogi For manual upgrade, just unzip the latest release (or any version) to overwrite previous installation

@kangyu-california is this Normal? I opened the "Auto_start_pw"

@Daksnapogi Windows 11 requires run auto_start_pw.bat as admin

@matti-kz mystery reproduced and root caused (I think)
#289

Difficult to say if it's the same issue, I for example don't use any scaling in Windows, 3 screens 2560x1440 with 100% scaling. The impacted monitor is not primary, all monitors are in the same orientation.
The only thing I noticed in my logs is

PersistentWindows: Restore aborted for Display_LocM2560x0_Res2560x1440__Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440
PersistentWindows: Restore aborted for Display_Loc0x0_Res2560x1440__Display_Loc2560x0_Res2560x1440

Which looks like one of the monitors is missing?

Some monitor may turn off and on then off within a very short period of time, PW respond to frequent display config change by abort and restart restore timer, hence the "Restore aborted" message, which is not an alarm signal usually.

I made a speculative fix to disable related DPI awareness function call for Windows 11.

Please try
PersistentWindows5.51_patch289.zip

It didn't help
events.zip
From the logs I can see it restored nothing after system wake up, then 10 mins later I noticed Spotify and VSCode are on the wrong screen again and moved them manually - it noticed that :)

The log shows Spotify moves to wrong screen by itself, well after auto restore is finished.
So your initial issue description "my problem is windows are not restored automatically on wake/screen disconnected on PW > 5.43 (found suggestion to roll back to this version in another issue).
Most notorious apps not restored are Spotify and VSCode - they always land on the main monitor (out of 3 in total)."
is far away from what really happens.

Well I can only describe the issue as observed.
"The log shows Spotify moves to wrong screen by itself, well after auto restore is finished." seems like exactly the case PersistentWindows is supposed to fix no? Sorry you feel this is a waste of time

Based on your observation that 5.43 does not have the issue, and other clues from #289, I have concluded that the issue was introduced since 5.45 due to adding dpi awareness setting to improve UI text sharpness on scaled monitor.

I am considering making a Win11 branch to fix this issue, the text sharpness enhancement will be discarded as inevitable collateral damage.

Just created win11 branch to remove the dpi awareness code, the new win11 patch is in 5.51 release page,
https://github.com/kangyu-california/PersistentWindows/files/14227995/PersistentWindows5.51_win11_patch.zip

I have been having a similar issue for a while. I turn off my monitors after work but when I turn them back on the windows do not restore to the monitors. I have to drag them from my laptop screen to the monitor screen. I am on version 5.51.8799.29711 and using Windows 10

I did not observe this behavior earlier. Earlier when I switched on my monitors all the windows used to restore to their original positions.

@s0j0urn try the win11 patch which should work on win10

The new patch didn't help me, again Spotify jumped to the main screen after monitors woke up.
events.zip

The problem remains unresolved for me. Despite attempts, I still had to manually move all my windows from the laptop screen to the monitors. I'll provide a more detailed update around the weekend.

I can't pinpoint the exact version that previously functioned seamlessly for me, but I am certain that there was a version in the past that worked flawlessly.

@s0j0urn as a workaround, you may use restore snapshot feature, all it takes is one mouse click on the pw icon. And according to mateuszkozakiewicz 5.43 is the last known working release.

Hmm I can't seem to start the 5.51 version, it shows a command prompt like this over and over. Tried without any parameters but without success.
image
Rolling back to 5.50 fixes it.

5.52 didn't work for me to restore windows after switching on the monitors again.
Going back to 5.43 to see if that version still works for me

@s0j0urn 5.52 contains two variants (master release and dpi_unaware release), if both of them does not work for you, then switch back to 5.43

Close with 5.53 release