fix: the display stays on while playing with a controller (#1532) #1538

Merged
NotRexed merged 2 commits from fix/display-awake into main 2026-11-10 08:16:40 +00:00
NotRexed commented 2026-11-10 07:16:48 +00:00 (Migrated from github.com)

Fixes #1532. Windows doesn't count controller input as user input, so playing with a controller, the display went off at the power plan's timeout. The game already blocked the screensaver, but not the display's power-off.

While the game's window is in front and not minimized, the display's idle timer is now reset every 30 s with SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED). Without ES_CONTINUOUS, nothing is held once the game is left, minimized or closed: Windows' own timers simply resume. HOS_KEEP_DISPLAY=0 turns it off. It runs on the window's existing 250 ms timer.

Tested: compiles cleanly with -Wall -Wextra.

🤖 Generated with Claude Code

Fixes #1532. Windows doesn't count controller input as user input, so playing with a controller, the display went off at the power plan's timeout. The game already blocked the screensaver, but not the display's power-off. While the game's window is in front and not minimized, the display's idle timer is now reset every 30 s with `SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED)`. Without `ES_CONTINUOUS`, nothing is held once the game is left, minimized or closed: Windows' own timers simply resume. `HOS_KEEP_DISPLAY=0` turns it off. It runs on the window's existing 250 ms timer. Tested: compiles cleanly with `-Wall -Wextra`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jcreveling commented 2026-11-10 18:09:55 +00:00 (Migrated from github.com)

still happening for me this morning after updating to current, but admittedly didn't do a ton of testing. not sure what else it could be, i have a pretty default windows install and haven't changed any power save settings etc... I'll check again tonight.

still happening for me this morning after updating to current, but admittedly didn't do a ton of testing. not sure what else it could be, i have a pretty default windows install and haven't changed any power save settings etc... I'll check again tonight.
Commenting is not possible because the repository is archived.
No description provided.