| Summary: | X11 SDL2 wakes monitor and prevents standby | ||
|---|---|---|---|
| Product: | SDL | Reporter: | captain.gxj |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus |
| Version: | don't know | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
|
Description
captain.gxj
2018-01-02 02:05:08 UTC
This is intentional; SDL turns off the screensaver (which likely causes this wakeup on X11) by default. Otherwise, movie players where someone is watching the screen but not interacting with the keyboard/mouse will have to fight with the screen turning off, as will games played with a joystick and not the usual input devices that X11 treats as "activity." If you don't want your app to wake up the screen like this, you can call this before SDL_Init()... SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1"); (SDL_EnableScreenSaver() also works after SDL_Init() is done, but we've probably woke the screen by then.) If it's not your program, you can export this environment variable to force that hint for any SDL-based program: export SDL_VIDEO_ALLOW_SCREENSAVER=1 --ryan. (In reply to Ryan C. Gordon from comment #1) Thanks for that, this solves my issue. So it seems like it's a complication for any Linux application on X11 wanting to prevent standby and the user wanting to lock the screen. Seems to work as expected under Wayland so I suppose its not a long term problem. |