So fyi, the way you hook it there is what makes the preview flicker in System Settings.
You check if the screen is locked, and if not, kill the host. But screen is not locked in System Settings. So basically, you're killing the host process every 2 seconds (and macOS, at least in Tahoe, restarts it, it doesn't in previous macOS versions).
That's also what causes your issues with "Options" not working (because you killed the instance that was linked to that button). The way we workaround it usually is to hook a system event.
Ha, you do the exit trick too then, I just missed it.
FYI that works 99% of the time, but for some people it sometimes crashes (because we exit our host container - legacyScreenSaver.appex - and sometimes if you do it at a wrong time things just hang).
cwizou|4 months ago
You check if the screen is locked, and if not, kill the host. But screen is not locked in System Settings. So basically, you're killing the host process every 2 seconds (and macOS, at least in Tahoe, restarts it, it doesn't in previous macOS versions).
That's also what causes your issues with "Options" not working (because you killed the instance that was linked to that button). The way we workaround it usually is to hook a system event.
You can check https://github.com/AerialScreensaver/ScreenSaverMinimal
Look for handleWillStopNotification and com.apple.screensaver.willstop
cwizou|4 months ago
FYI that works 99% of the time, but for some people it sometimes crashes (because we exit our host container - legacyScreenSaver.appex - and sometimes if you do it at a wrong time things just hang).