summaryrefslogtreecommitdiffstats
path: root/client/X11/xf_input.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:12 +0000
commit827a4c3faa27e0c186452585b15094eee1119085 (patch)
treee6a08b0c767863d66f7d4a9de80db5edc7db29be /client/X11/xf_input.c
parentReleasing progress-linux version 3.3.0+dfsg1-1~progress7.99u1. (diff)
downloadfreerdp3-827a4c3faa27e0c186452585b15094eee1119085.tar.xz
freerdp3-827a4c3faa27e0c186452585b15094eee1119085.zip
Merging upstream version 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.c29
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: