[client,sdl] use SDL_WaitEventTimeout

polling is expensive, so use a waitable function instead
This commit is contained in:
akallabeth
2023-08-31 08:53:51 +02:00
committed by akallabeth
parent ffb9584e56
commit 285add3a85

View File

@@ -706,7 +706,8 @@ static int sdl_run(SdlContext* sdl)
while (!freerdp_shall_disconnect_context(sdl->context()))
{
SDL_Event windowEvent = { 0 };
while (!freerdp_shall_disconnect_context(sdl->context()) && SDL_PollEvent(nullptr))
while (!freerdp_shall_disconnect_context(sdl->context()) &&
SDL_WaitEventTimeout(nullptr, 1000))
{
/* Only poll standard SDL events and SDL_USEREVENTS meant to create dialogs.
* do not process the dialog return value events here.