News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Windows Disable Screensaver Sleep

Started by DrSuperGood, March 07, 2016, 06:35:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DrSuperGood

Small patch which disables screensaver and sleep while Simutrans is in focus. Minimize Simutrans and screensaver and sleep mode will activate as normal.

Ters

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?

DrSuperGood

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.

Ters

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.

prissi

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.