The International Simutrans Forum

Development => Patches & Projects => Topic started by: DrSuperGood on March 07, 2016, 06:35:29 AM

Title: Windows Disable Screensaver Sleep
Post by: DrSuperGood on March 07, 2016, 06:35:29 AM
Small patch which disables screensaver and sleep while Simutrans is in focus. Minimize Simutrans and screensaver and sleep mode will activate as normal.
Title: Re: Windows Disable Screensaver Sleep
Post by: Ters on March 07, 2016, 06:51:45 AM
Looks like this is only when running full screen.

By the way: Maybe disabling sleep might be useful for servers as well. Or is there code for that already?
Title: Re: Windows Disable Screensaver Sleep
Post by: DrSuperGood on March 07, 2016, 04:52:25 PM
QuoteLooks like this is only when running full screen.
That should not be the case as it should activate when the window is created. Perhaps the window events are not set up properly for windowed mode though as I am not too sure about them.

Quote
By the way: Maybe disabling sleep might be useful for servers as well. Or is there code for that already?
In theory light sleep mode is still permitable as it was designed for purposes like DVRs where video capture should always be possible. In any case this would need changes to the POSIX front.
Title: Re: Windows Disable Screensaver Sleep
Post by: Ters on March 07, 2016, 09:53:47 PM
Quote from: DrSuperGood on March 07, 2016, 04:52:25 PM
That should not be the case as it should activate when the window is created. Perhaps the window events are not set up properly for windowed mode though as I am not too sure about them.

Ah. I didn't check the second diff block. The thirds and fourth diff blocks are within an if(is_fullscreen) scope.

I'm not so convinced that this is a good idea to hardcode on. In particular, I might not mind the screen blanking (does anybody actually use screensavers anymore?) if I'm idle long enough. If I'm not moving the mouse or using the keyboard for that long, I'm probably not paying attention to Simutrans. Turning off sleep might be OK, so long as Windows can overrule it if running low on battery.
Title: Re: Windows Disable Screensaver Sleep
Post by: prissi on March 07, 2016, 11:40:03 PM
I think, I would like to darken the screen, if there is nobody looking at it. (And I know people who did run Simutrans over night and would like to do so without fiddling with the screen setting. Keeping windows running seems ok though.