Skip to content

Commit

Permalink
Unchecked Return Value in WIN_SuspendScreenSaver (#12316)
Browse files Browse the repository at this point in the history
  • Loading branch information
thouravi authored Feb 17, 2025
1 parent 057c360 commit 31f9cb4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/video/windows/SDL_windowsvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,15 @@ static void SDLCALL UpdateWindowFrameUsableWhileCursorHidden(void *userdata, con
#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
static bool WIN_SuspendScreenSaver(SDL_VideoDevice *_this)
{
DWORD result;
if (_this->suspend_screensaver) {
SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED);
result = SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED);
} else {
SetThreadExecutionState(ES_CONTINUOUS);
result = SetThreadExecutionState(ES_CONTINUOUS);
}
if (result == 0) {
SDL_SetError("SetThreadExecutionState() failed");
return false;
}
return true;
}
Expand Down

0 comments on commit 31f9cb4

Please sign in to comment.