Unchecked Return Value in WIN_SuspendScreenSaver (#12316)
Build (All) / Create test plan (push) Waiting to run
Build (All) / level1 (push) Blocked by required conditions
Build (All) / level2 (push) Blocked by required conditions

This commit is contained in:
ImThour
2025-02-18 05:06:56 +05:30
committed by GitHub
parent 057c3602e9
commit 31f9cb4806
+7 -2
View File
@@ -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;
}