mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Fix screensaver disabled unexpectedly
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 <https://github.com/Genymobile/scrcpy/pull/6754> Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
parent
de3db42997
commit
758d0a1cc0
1 changed files with 2 additions and 6 deletions
|
|
@ -140,7 +140,7 @@ sdl_set_hints(const char *render_driver) {
|
|||
}
|
||||
|
||||
static void
|
||||
sdl_configure(bool video_playback, bool disable_screensaver) {
|
||||
sdl_configure(bool disable_screensaver) {
|
||||
#ifdef _WIN32
|
||||
// Clean up properly on Ctrl+C on Windows
|
||||
bool ok = SetConsoleCtrlHandler(windows_ctrl_handler, TRUE);
|
||||
|
|
@ -149,10 +149,6 @@ sdl_configure(bool video_playback, bool disable_screensaver) {
|
|||
}
|
||||
#endif // _WIN32
|
||||
|
||||
if (!video_playback) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (disable_screensaver) {
|
||||
bool ok = SDL_DisableScreenSaver();
|
||||
if (!ok) {
|
||||
|
|
@ -544,7 +540,7 @@ scrcpy(struct scrcpy_options *options) {
|
|||
}
|
||||
}
|
||||
|
||||
sdl_configure(options->video_playback, options->disable_screensaver);
|
||||
sdl_configure(options->disable_screensaver);
|
||||
|
||||
// Await for server without blocking Ctrl+C handling
|
||||
bool connected;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue