Skip to content

Commit

Permalink
[client,common] fix TS_RELPOINTER_EVENT sending logic
Browse files Browse the repository at this point in the history
Send relative mouse events using TS_RELPOINTER_EVENT only when capability present
  • Loading branch information
sasha0552 authored and akallabeth committed Mar 22, 2024
1 parent 31a131b commit c6dd5e4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions client/common/client.c
Expand Up @@ -1574,8 +1574,9 @@ BOOL freerdp_client_send_button_event(rdpClientContext* cctx, BOOL relative, UIN

WINPR_ASSERT(cctx);

const BOOL relativeInput = freerdp_client_use_relative_mouse_events(cctx);
if (relative && relativeInput)
const BOOL haveRelative =
freerdp_settings_get_bool(cctx->context.settings, FreeRDP_HasRelativeMouseEvent);
if (relative && haveRelative)
{
return freerdp_input_send_rel_mouse_event(cctx->context.input, mflags, x, y);
}
Expand All @@ -1585,7 +1586,7 @@ BOOL freerdp_client_send_button_event(rdpClientContext* cctx, BOOL relative, UIN
{
UINT64 flags = 0;

if (cctx->mouse_grabbed && relativeInput)
if (cctx->mouse_grabbed && freerdp_client_use_relative_mouse_events(cctx))
flags |= AINPUT_FLAGS_HAVE_REL;

if (relative)
Expand Down Expand Up @@ -1630,7 +1631,9 @@ BOOL freerdp_client_send_extended_button_event(rdpClientContext* cctx, BOOL rela
BOOL handled = FALSE;
WINPR_ASSERT(cctx);

if (relative && freerdp_client_use_relative_mouse_events(cctx))
const BOOL haveRelative =
freerdp_settings_get_bool(cctx->context.settings, FreeRDP_HasRelativeMouseEvent);
if (relative && haveRelative)
{
return freerdp_input_send_rel_mouse_event(cctx->context.input, mflags, x, y);
}
Expand Down

0 comments on commit c6dd5e4

Please sign in to comment.