diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:25:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:25:11 +0000 |
commit | 941f9937e0744d18de4cc0afa71e0caa925d82ac (patch) | |
tree | 67872b86dbf72d73e91188bf8de12594668fe4aa /client/X11/xf_input.c | |
parent | Adding upstream version 3.3.0+dfsg1. (diff) | |
download | freerdp3-941f9937e0744d18de4cc0afa71e0caa925d82ac.tar.xz freerdp3-941f9937e0744d18de4cc0afa71e0caa925d82ac.zip |
Adding upstream version 3.5.0+dfsg1.upstream/3.5.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'client/X11/xf_input.c')
-rw-r--r-- | client/X11/xf_input.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/client/X11/xf_input.c b/client/X11/xf_input.c index f1cdc83..dfbe051 100644 --- a/client/X11/xf_input.c +++ b/client/X11/xf_input.c @@ -200,7 +200,7 @@ static BOOL register_raw_events(xfContext* xfc, Window window) settings = xfc->common.context.settings; WINPR_ASSERT(settings); - if (freerdp_client_use_relative_mouse_events(&xfc->common)) + if (freerdp_settings_get_bool(settings, FreeRDP_MouseUseRelativeMove)) { XISetMask(mask_bytes, XI_RawMotion); XISetMask(mask_bytes, XI_RawButtonPress); @@ -780,21 +780,26 @@ int xf_input_event(xfContext* xfc, const XEvent* xevent, XIDeviceEvent* event, i switch (evtype) { case XI_ButtonPress: - xfc->xi_event = TRUE; - xf_generic_ButtonEvent(xfc, (int)event->event_x, (int)event->event_y, event->detail, - event->event, xfc->remote_app, TRUE); - break; - case XI_ButtonRelease: - xfc->xi_event = TRUE; - xf_generic_ButtonEvent(xfc, (int)event->event_x, (int)event->event_y, event->detail, - event->event, xfc->remote_app, FALSE); + xfc->xi_event = !xfc->common.mouse_grabbed || + !freerdp_client_use_relative_mouse_events(&xfc->common); + + if (xfc->xi_event) + { + xf_generic_ButtonEvent(xfc, (int)event->event_x, (int)event->event_y, event->detail, + event->event, xfc->remote_app, evtype == XI_ButtonPress); + } break; case XI_Motion: - xfc->xi_event = TRUE; - xf_generic_MotionNotify(xfc, (int)event->event_x, (int)event->event_y, event->detail, - event->event, xfc->remote_app); + xfc->xi_event = !xfc->common.mouse_grabbed || + !freerdp_client_use_relative_mouse_events(&xfc->common); + + if (xfc->xi_event) + { + xf_generic_MotionNotify(xfc, (int)event->event_x, (int)event->event_y, + event->detail, event->event, xfc->remote_app); + } break; case XI_RawButtonPress: case XI_RawButtonRelease: |