Skip to content

Fix screensaver disabled unexpectedly#6754

Closed
ayooh wants to merge 1 commit into
Genymobile:devfrom
ayooh:screensaver_fix
Closed

Fix screensaver disabled unexpectedly#6754
ayooh wants to merge 1 commit into
Genymobile:devfrom
ayooh:screensaver_fix

Conversation

@ayooh
Copy link
Copy Markdown
Contributor

@ayooh ayooh commented Apr 5, 2026

If the value of video_playback is false (e.g., when --no-video, --no-window, or no-video-playback is passed), the screensaver is disabled by default, according to this ref.

By default, scrcpy does not prevent the screensaver from running on the computer unless the --disable-screensaver option is passed.

Related: #5099

By default, scrcpy does not prevent the screensaver from running on the
computer unless the `--disable-screensaver` option is passed.
@rom1v
Copy link
Copy Markdown
Collaborator

rom1v commented Apr 6, 2026

Thank you 👍

I agree with the change. I noticed that the screensaver can also be set using a hint, so I made some refactors.

Please review the entire branch and confirm that it works as expected: fix-screensaver.2

@ayooh
Copy link
Copy Markdown
Contributor Author

ayooh commented Apr 6, 2026

Thanks for the refactor! I’ve reviewed the branch and confirmed that it works as expected.

rom1v pushed a commit that referenced this pull request Apr 7, 2026
By default, scrcpy does not prevent the screensaver from running on the
computer unless the `--disable-screensaver` option is passed.

Otherwise, `SDL_EnableScreenSaver()` must be called explicitly, since
SDL disables the screensaver by default.

Refs <https://wiki.libsdl.org/SDL3/SDL_DisableScreenSaver>
PR #6754 <#6754>

Signed-off-by: Romain Vimont <rom@rom1v.com>
rom1v added a commit that referenced this pull request Apr 7, 2026
Some hints can be useful even when window is dsabled.

Refs #6754 <#6754>
rom1v added a commit that referenced this pull request Apr 7, 2026
SDL disables the screensaver by default. It can be configured via a
hint instead of explicitly calling `SDL_EnableScreenSaver()`.

Refs #6754 <#6754>
rom1v added a commit that referenced this pull request Apr 7, 2026
The function `sdl_configure()` now only sets the Ctrl+C handler on
Windows. Define it only on Windows, and call it earlier.

Refs #6754 <#6754>
@rom1v
Copy link
Copy Markdown
Collaborator

rom1v commented Apr 7, 2026

Merged into dev:

🚀

@rom1v rom1v closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants