[client,sdl] add error checks and logs

This commit is contained in:
akallabeth
2026-01-28 19:05:58 +01:00
parent 2bec6913a8
commit fe9a1b0eed
3 changed files with 8 additions and 7 deletions

View File

@@ -664,7 +664,10 @@ int SdlContext::sdl_client_thread_run(std::string& error_msg)
const DWORD status = WaitForMultipleObjects(nCount, handles, FALSE, INFINITE);
if (status == WAIT_FAILED)
{
WLog_Print(getWLog(), WLOG_ERROR, "WaitForMultipleObjects WAIT_FAILED");
break;
}
if (!freerdp_check_event_handles(context()))
{

View File

@@ -309,16 +309,14 @@ bool sdlInput::keyboard_focus_in()
WINPR_ASSERT(input);
auto syncFlags = sdl_get_kbd_flags();
freerdp_input_send_focus_in_event(input, WINPR_ASSERTING_INT_CAST(uint16_t, syncFlags));
if (!freerdp_input_send_focus_in_event(input, WINPR_ASSERTING_INT_CAST(uint16_t, syncFlags)))
return false;
/* finish with a mouse pointer position like mstsc.exe if required */
// TODO: fullscreen/remote app
float fx = 0.0f;
float fy = 0.0f;
if (_sdl->fullscreen())
SDL_GetGlobalMouseState(&fx, &fy);
else
SDL_GetMouseState(&fx, &fy);
SDL_GetMouseState(&fx, &fy);
auto w = SDL_GetMouseFocus();
const auto& pos = _sdl->screenToPixel(SDL_GetWindowID(w), SDL_FPoint{ fx, fy });

View File

@@ -1771,8 +1771,8 @@ BOOL freerdp_client_send_button_event(rdpClientContext* cctx, BOOL relative, UIN
cctx->lastX = x;
cctx->lastY = y;
}
freerdp_input_send_mouse_event(cctx->context.input, mflags, (UINT16)cctx->lastX,
(UINT16)cctx->lastY);
return freerdp_input_send_mouse_event(cctx->context.input, mflags, (UINT16)cctx->lastX,
(UINT16)cctx->lastY);
}
return TRUE;
}