Add screensaver restore behaviour#606
Conversation
|
Also deals with #599 |
scottdraves
left a comment
There was a problem hiding this comment.
The diagnostic logging in ScreensaverInstallerWin32.cpp was removed in this PR — the prior version logged the opt-out skip, the missing .scr case, the registry-open failure, and the before/after values when SCRNSAVE.EXE or ScreenSaveActive changed. Could we put those back, and add equivalents on the new save/restore paths (e.g. what was captured into the backup, what was written back on restore, and any failure to open the Desktop or backup keys)?
This code touches the Windows registry on user machines we can't debug interactively, and runtime logs are written to C:\ProgramData\Infinidream\Logs\YYYY_MM_DD.log precisely so we can diagnose this kind of thing after the fact. If a user reports "my screensaver didn't come back when I unchecked Keep," the log is the only signal we have — right now it would say nothing.
|
this is good but 599 and 602 are very related, it might make sense to do them together. |
|
Yeah I saw 599 after this, and realised it answers both problems. Gunna get the logging put back in and commit and then wait for further plans |
|
for one thing, we have a settings.json file, would it make sense to store the previous setting there, instead of in the registry? |
|
Every time I tried to store it in the settings.json it would get overwritten. Although that was before the logic change of 'if isn't already infinidream'. Will test more tomorrow. |
|
Problem SaveOriginalScreensaverSettingsOnce is called before CElectricSheep::Startup(), while settings is still read-write. This ensures the backup is written to and committed to settings.json successfully. ScreensaverInstallerWin32.cpp was also refactored to store the backup in settings.json (via settings.app.screensaver_backup) rather than a separate registry key, keeping all app state in one place. A verify read-back log line was added to SaveBackupToSettings to aid future debugging. First launch: user's previous screensaver (exe, timeout, active state) is saved to settings.json, Infinidream is set as the active screensaver |
Fixes Windows screensaver handling so disabling “Keep screensaver enabled” restores the user’s previous screensaver. If none, then goes back to none, if other selected, that is restored.
The app now captures the current Windows screensaver state before applying Infinidream, but avoids saving Infinidream itself as the restore target. It stores the restore state in HKCU and applies/restores immediately when the setting is toggled.
Looking #602