Change default project setting keep_screen_on to false#1313
Conversation
WalkthroughThe default for ChangesKeep Screen On Default
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
It's kinda funny you opened this here, we were just talking internally about your PR you opened upstream the other day. But I think this needs broader community input. I think this is probably a no-brainer for ARM based devices, where sleep mode is essentially a first class citizen and receives extensive testing and support since these devices are expected to spend like 95% of their day sleeping on battery. But my experiences with x86/x64 have been much more hit or miss. I think in general OSes have gotten pretty decent at inferring when/if they should inhibit sleep themselves, but is still not always great at it. Such as detecting if a game or video has exclusive fullscreen, etc. But they are not always perfect, especially across Linux distros. There is nothing more frustrating as an end user than playing a game with a controller and then the computer decide to go to sleep because I havent touched the mouse or keyboard and that particular Distro / Desktop Environment didnt think to include inputs for other device types like gamepads. Or when Plasma stops recognizing that I have enabled Presentation Mode... Or edge cases where some HDMI displays like televisions can electrically disable the HDMI link after a device has gone to sleep, so that when it initially resumes, there is initially no display connected. Which can cause other problems, especially when running something like a game. All of that to say, I definitely see value in keeping the default value for At the end of the day, whether this setting is enabled or disabled on any given title is up to the developer of that title, regardless of if we change the default behavior or not. What I think I am going to do is open a community poll and try and get a discussion going on this to get more perspectives on the subject, and go from there. |
|
Speaking of the community poll feel free to join our discord server if you want, https://discord.gg/redot most of our community is there so you'll get a chance to talk about the feature with other people |
|
This may be a little counter-productive to my point, but from my research it seems that some (many?) games inadvertently keep the system awake due to constantly-playing audio streams (even when they are silent). Windows and some other OSs can register silent audio streams as "playing content" that warrants keeping the system awake (see: godotengine/godot#28039). Similar to Linux controller sleep issues, I don't think it's within the scope of Redot to try to "fix" issues that some OSes/distros might have with improper controller input handling (maybe I'm biased because I haven't personally had that sort of issue). I would suggest for those users affected by issues like that to use their OS's features to disable sleep if it becomes a problem (KDE Plasma has a handy feature to temporarily disable sleep/screen locking: |
JoltedJon
left a comment
There was a problem hiding this comment.
After our talk on discord I'm convinced this would be a better default. This is a more advanced feature to enable and the fact that users of the game cannot disable it makes it more reason to have it off by default. My assumption is that most users probably don't even know about this setting to begin with
Arctis-Fireblight
left a comment
There was a problem hiding this comment.
I've more or less changed my position on this after discussions on Discord, and am supportive of this change.
This is probably something that should be opt-in vs opt-out. And as others have mentioned here and on Discord, I dont think most Godot or Redot users know that this setting exists, let alone the ramifications this may or may not have on their end user's systems.
I will keep this PR open for about another 24 hours or so to allow for more commentary.

This PR changes the default project setting display/window/energy_saving/keep_screen_on to false
This aligns the default value to what seems to be the standard among game engines, as "do not inhibit sleep", and avoids overriding and disregarding user preference for system sleep.
This is a port of godotengine/godot#121351, and godotengine/godot-proposals#15187
It seems that in most cases, inhibiting sleep is not explicitly desired, and thus it's less intrusive to not intervene with the system's power-saving measures.
Because it's relevant, I will share some data I created on "sleep inhibition by default" is normal or warranted for games (it seems to be a tense subject for many)
Out of 37 games tested, only 4 actively inhibited system sleep:
The 33 games that did not inhibit sleep included games made in Unity, Unreal, Source, as well as numerous proprietary engines/frameworks.
Details
Redot appears to be an outlier among the major game engines by enabling sleep inhibition by default through a global project setting, whereas both Unity and Unreal require explicit API calls to prevent system sleep:
Screen.sleepTimeout = SleepTimeout.NeverSleep;FPlatformMisc::ControlScreensaver(FPlatformMisc::EScreenSaverAction::Disable);In this way Unity and Unreal nudge developers to only enable sleep inhibitors in contexts where they are actually needed, instead of at all times. This helps to ensure that the user's system power settings are respected by default.
Summary by CodeRabbit