cnapolit / ScreenSaver

Extension for Playnite to dynamically display game content as a screen saver
MIT License
7 stars 0 forks source link

Ignore inputs when playnite is deactivated or minimized #48

Open PhilippeCadieux opened 1 year ago

PhilippeCadieux commented 1 year ago

Since I have Playnite opened on my third monitor (TV) at all time, the option to have some kind of slide show showing on there while I'm not playing is really great to avoid burn-in. However, since I am still using the PC in the meantime, the screensaver will never actually turn on.

Having an option to have the Screensaver trigger when there's x amount of time of inactivity in Playnite specifically (and not on the PC at large) and then requiring for the user to click on the window or some other kind of input to exit the Screen Saver when they want to use Playnite to launch a game would make it work perfectly with this use case.

cnapolit commented 1 year ago

While I am not sure how much information I can extract from the main app, one solution could be controlling how the plugin determines when to close i.e. only closing when the screen saver window is directly clicked may be a solution.

I'll explore both paths, but does limiting input sound good for your use case? Would you want this behavior to be specific to the playnite mode (Desktop Vs Fullscreen)?

PhilippeCadieux commented 1 year ago

Well my very specific use case is that Playnite is pretty much always opened, in fullscreen mode, on my TV whenever my PC is on. Having it start automatically after time of inactivity within Playnite like I mentioned above would be neat for sure but really, any way to start and stop it manually would work great in my case.

I'm not sure how much addons can do as far as accepting inputs from users or, even better, adding some kind of button to the main UI?

Ideally I'd want Playnite to be displaying your screen saver when it's on (which is always in my case) but not actively in use (so no game running). How the Screensaver is actually started and stopped doesn't really matter for me but it's just that I can't use "standard" Screensaver rules as I am using the PC so it never really goes idle.

cnapolit commented 1 year ago

I do have a story for supporting hotkeys (#27).

I could basically ignore inputs and display after the set amount of time when the app is minimized or deactivated. I'll convert this story for that feature.

As for a UI option, since the game & main menus in Desktop mode don't exist in Fullscreen mode, whatever I would hypothetically implement would need to be supported on a per theme basis. Given how small the added functionality would be, I can't see many theme devs supporting it. If Playnite adds generic UI support for plugins when fullscreen in the future, then it would be viable. Sadly, it's probably not worth it until then.

PhilippeCadieux commented 1 year ago

Ah gotcha and the would the hotkeys also work in Fullscreen mode are they also relying on the theme?

If they work in Fullscreen mode then I would ideally just need a way to turn off the automatic start of the screensaver. It might already be possible? Not sure. If not then maybe I'd setting it to 0 seconds of inactivity could be a way to disable the timer?

Then I could simply have a hotkey to start it and one to turn it off whenever needed.

Thanks a lot for the great support of my weird use case haha. No worries if it ends up not being possible.

cnapolit commented 1 year ago

The hotkeys would work independently of mode or theme.

Yep, it is already possible. In the addon settings there is a drop down labelled 'when to play'. Setting it to never or desktop will prevent the ScreenSaver from automatically displaying during fullscreen mode. Manual starts will still work.

No problem. Thanks for the quick feedback, helps iron out the specifics. I've honestly thought of setting up this scenario myself, just didn't apply it to the plugin. It's certainly possible to implement, it just takes time.