RandScullard/photo-screen-saver

Does not load on Win10 20H2

Closed this issue · 15 comments

orgi commented

I created a very simplistic screen saver (actually by replacing the index.html with just displaying 'foo').
This works find as long as I start the screen saver by clicking on the exe.

When I open the developer tools from within the screen saver, they won't show anything. As if no web page was loaded.

However, when I try to run it as a screen saver, the screen turns all while, but nothing gets displayed. Somehow I fear there may be some security setting preventing the screen saver to load. However it is all working find by loading a java-based (self-written) screen saver.

You have a clue what I could do?

Screen looks like:
image

Does it work if you install an unmodified version of photo-screen-saver? Can you describe the steps you are taking to install and test your screen saver?

orgi commented

Thanks for the swift response.

Actually I did not yet try with an unmodified version, as I feared it may be even harder to track down the issue. Mainly I thought that if a minimal html w/o any javascript code would not load, why should the full-blown version?

Plus, testing the screen saver works fine (running it manually, double-click on the .exe or running the .scr with the /s argument). I also tried running it from the command line, also using something else for the current working directory. Still working fine.

The only thing that does not work is actually running it automatically after the timeout.

Therefore I'm sure that something has to be different when letting the timeout trigger the screen saver. Since also my self-written minimal electron app shows the same behavior I fear that it may be related to electron itself after all.

We also have two other self-written screen savers in place, one of them is java-based, the other one .net-based. Both are working as expected.

About the installation:
I tried the following:

  • Installing it directly into the registry
  • Using the 'Install' link when right-clicking on the *.scr file

None of them would work. I always get the same result. Not sure what would be the best way to debug, since the built-in debugger does not seem to work either.

You think it will make sense to try getting the full-blown screen saver working?

Does it work correctly when you click the Preview button in the Windows Screen Saver Settings dialog?

orgi commented

Yes, working perfectly fine when using the Preview button.

OK, the interesting thing about that is that Windows launches the screen saver with the same command line (photo-screen-saver.scr /s) when you click the Preview button as when it is started due to the idle timeout. However, when you click the Preview button the screen saver is launched as a normal process under your account, but when it is started due to the idle timeout, the winlogon.exe process launches it. On my system it works fine either way, but that might be making a critical difference on your system. You might want to try Process Hacker or a similar tool to see if there is anything odd about the screen saver process when it is launched by winlogon.exe. You could also use Process Monitor to see if it is failing to access any files - maybe there is something wrong with the ACL on the folder where the .scr file is located.

orgi commented

Thanks, I'll give it a shot.

Do me a favor and let me know what you find. I'm interested to know what's causing the problem.

orgi commented

Sure thing. Unfortunately I was not yet able to find anything. Tried with the process monitor so far. Have to see what I can do with the process hacker…

I finally reproduced this on another PC. It turns out that the blank white window only appears if you have the "On resume, display login screen" setting turned off. Since my PC had that setting turned on, I wasn't seeing the behavior.

Luckily there was an easy fix: I found that deleting the call to setAlwaysOnTop(true) fixed the issue. It seems this call wasn't needed anyway, since deleting it doesn't change any behavior. Thanks to @orgi for the report!

orgi commented

Correction: The prior commit only fixed the problem on one of my PCs. The latest commit really seems to do the trick. It turns out
that the fix is to delay loading index.html for a few seconds - for some reason this only makes a difference when running in true screen saver mode.

I can confirm, that it is working now for me, too :)
Thanks!

Correction: The prior commit only fixed the problem on one of my PCs. The latest commit really seems to do the trick. It turns out
that the fix is to delay loading index.html for a few seconds - for some reason this only makes a difference when running in true screen saver mode.

FYI: For us to fully work, even right after booting the machine, we needed to even increase the timeout. Did not try a lot, just increased it to 10s, and it worked :)

orgi commented

Works for me :)

Thanks for letting me know, @schwaerz and @orgi. I wish I understood the underlying cause and why some machines need a long timeout - even three seconds seems like a long time to have to wait!