mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[client,sdl] add error checks and logs
This commit is contained in:
@@ -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()))
|
||||
{
|
||||
|
||||
@@ -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 });
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user