Author Topic: Windows Disable Screensaver Sleep  (Read 1398 times)

0 Members and 1 Guest are viewing this topic.

Offline DrSuperGood

Windows Disable Screensaver Sleep
« 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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4677
  • Total likes: 170
  • Helpful: 108
  • Languages: EN, NO
Re: Windows Disable Screensaver Sleep
« Reply #1 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?

Offline DrSuperGood

Re: Windows Disable Screensaver Sleep
« Reply #2 on: March 07, 2016, 04:52:25 PM »
Quote
Looks 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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4677
  • Total likes: 170
  • Helpful: 108
  • Languages: EN, NO
Re: Windows Disable Screensaver Sleep
« Reply #3 on: March 07, 2016, 09:53:47 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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8752
  • Total likes: 305
  • Helpful: 229
  • Languages: De,EN,JP
Re: Windows Disable Screensaver Sleep
« Reply #4 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.