Skip to content

Change default project setting keep_screen_on to false#1313

Open
addmix wants to merge 1 commit into
Redot-Engine:masterfrom
addmix:master
Open

Change default project setting keep_screen_on to false#1313
addmix wants to merge 1 commit into
Redot-Engine:masterfrom
addmix:master

Conversation

@addmix

@addmix addmix commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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)

NOTE: This is not an exhaustive list (lol), and consists of the games that I currently have installed on my system.
I verified the sleep inhibitor status using powercfg /requests in an elevated PowerShell. On Linux, the same can be checked with systemd-inhibit --list
I did not test games that are demos, playtests, or otherwise irrelevant

Out of 37 games tested, only 4 actively inhibited system sleep:

  • Counter Strike 2
  • Deadlock
  • Overwatch
  • Helldivers 2

The 33 games that did not inhibit sleep included games made in Unity, Unreal, Source, as well as numerous proprietary engines/frameworks.

As a small anecdote, I asked a few people about their expectations regarding games and system sleep. A common response was that they believed preventing sleep was simply the "industry standard" and had been that way for as long as they could remember.

I was given very similar responses from multiple individuals, which to me suggests one of two things: Those that responded do not recall their systems sleeping unexpectedly while in-game and therefore assumed games were explicitly inhibiting sleep, or, that some other mechanism prevented system sleep, possibly a similar issue to #28039 where silent audio plays, which the OS registers as "playing content" and prevents sleep. If so, this may be more of a Windows behavior than a Godot-specific issue.

image
Details
Game Inhibits sleep Engine Notes:
Minecraft No Proprietary  
BattleBit Remastered No Unity  
Phasmophobia No Unity  
Peak No Unity  
War Thunder No Proprietary (Dagor Engine)  
BeamNG.Drive No Proprietary  
Counter-Strike 2 Yes Source 2  
Golf It! No Unreal Engine 4  
Garry’s Mod No Source  
MECCHA CHAMELEON No Unreal Engine 5  
Bellum No Unreal Engine 5  
Yap Uap No Unity  
RISK: Global Domination No Unity  
Squad No Unreal Engine 5  
Overwatch Yes Proprietary Keep awake reason is shown as: SYSTEM: [PROCESS] \Device\HarddiskVolume3\Program Files (x86)\Steam\steamapps\common\Overwatch\Overwatch.exe, meaning the screen can turn off, but the system cannot suspend
Brawlhalla No Proprietary  
Deadlock Yes Source 2  
Portal 2 No Source  
Stormworks: Build and Rescue No Proprietary  
VRChat No Unity  
Satisfactory No Unreal Engine 5  
Splitgate No Unreal Engine 4  
Rocket League No Unreal Engine 3  
Helldivers 2 Yes Proprietary Keep awake reason is shown as: SYSTEM: [PROCESS] \Device\HarddiskVolume3\Program Files (x86)\Steam\steamapps\common\Helldivers 2\bin\helldivers2.exe, meaning the screen can turn off, but the system cannot suspend
Beyond The Wire No Unreal Engine 4  
Insurgency: Sandstorm No Unreal Engine 4  
Automation – The Car Company Tycoon Game No Unreal Engine 4  
Burglin’ Gnomes No Unity  
Cheese Rolling No Unity  
Deep Rock Galactic No Unreal Engine 4  
Gamble With Your Friends No Unity  
A Game About Digging A Hole No Unreal Engine 5  
Juno: New Origins No Unity  
R.E.P.O. No Unity  
Restaurats No Unity  
RV There Yet? No Unreal Engine 5  
Ultimate Chicken Horse No Unity  

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:

  • Unity: Screen.sleepTimeout = SleepTimeout.NeverSleep;
  • Unreal: 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

  • Changes
    • The default project setting for keeping the screen on during energy-saving mode is now disabled.
    • Updated the setting’s documentation to reflect the new default.

@addmix
addmix requested review from a team July 17, 2026 19:31
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The default for display/window/energy_saving/keep_screen_on changes from true to false in both ProjectSettings initialization and its XML documentation.

Changes

Keep Screen On Default

Layer / File(s) Summary
Update setting default
core/config/project_settings.cpp, doc/classes/ProjectSettings.xml
The runtime and documented defaults for display/window/energy_saving/keep_screen_on are changed from true to false.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately describes the main change: flipping the keep_screen_on default to false.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Arctis-Fireblight

Arctis-Fireblight commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

It's kinda funny you opened this here, we were just talking internally about your PR you opened upstream the other day.
I have mixed feelings about this change to be honest.

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 keep_screen_on as true, at least in the context of Desktop use cases. But I am also not married to it.

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.

@JoltedJon

Copy link
Copy Markdown
Contributor

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

@addmix

addmix commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

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:

Detailsimage

@Shakai-Dev Shakai-Dev added this to the Redot LTS 26.3 milestone Jul 18, 2026

@Shakai-Dev Shakai-Dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM & is a small change

@JoltedJon JoltedJon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Arctis-Fireblight left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants