2023-07-17 18:18:33 -07:00
|
|
|
From d45e910803dd78f892ddece1743849943d7c67f3 Mon Sep 17 00:00:00 2001
|
2021-10-28 01:37:27 -07:00
|
|
|
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
|
|
|
Date: Mon, 25 Oct 2021 11:48:00 +0200
|
2021-10-29 03:37:16 -07:00
|
|
|
Subject: [PATCH] winex11.drv: Send relative RawMotion events unprocessed.
|
2021-10-28 01:37:27 -07:00
|
|
|
|
|
|
|
This makes relative raw input independent from cursor speed, as it is
|
|
|
|
the case on Windows. Absolute raw input is already translated to
|
|
|
|
virtual desktop space, and cursor speed is meaningless in this case.
|
|
|
|
|
|
|
|
This does not support mixed relative/absolute X/Y axis.
|
|
|
|
---
|
2023-07-17 18:18:33 -07:00
|
|
|
dlls/winex11.drv/mouse.c | 18 ++++++++++++------
|
|
|
|
1 file changed, 12 insertions(+), 6 deletions(-)
|
2021-10-28 01:37:27 -07:00
|
|
|
|
|
|
|
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
|
2023-07-17 18:18:33 -07:00
|
|
|
index 4a42b3c85b6..e58ee125c95 100644
|
2021-10-28 01:37:27 -07:00
|
|
|
--- a/dlls/winex11.drv/mouse.c
|
|
|
|
+++ b/dlls/winex11.drv/mouse.c
|
2023-07-17 18:18:33 -07:00
|
|
|
@@ -1770,12 +1770,12 @@ static BOOL X11DRV_DeviceChanged( XGenericEventCookie *xev )
|
2021-12-22 15:22:27 -08:00
|
|
|
return TRUE;
|
2021-10-28 01:37:27 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
-static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
|
|
|
|
+static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input, RAWINPUT *rawinput )
|
|
|
|
{
|
|
|
|
struct x11drv_thread_data *thread_data = x11drv_thread_data();
|
|
|
|
XIValuatorClassInfo *x = &thread_data->x_valuator, *y = &thread_data->y_valuator;
|
|
|
|
- double x_value = 0, y_value = 0, x_scale, y_scale;
|
|
|
|
- const double *values = event->valuators.values;
|
|
|
|
+ const double *values = event->valuators.values, *raw_values = event->raw_values;
|
|
|
|
+ double x_raw = 0, y_raw = 0, x_value = 0, y_value = 0, x_scale, y_scale;
|
|
|
|
RECT virtual_rect;
|
|
|
|
int i;
|
|
|
|
|
2023-07-17 18:18:33 -07:00
|
|
|
@@ -1804,22 +1804,30 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
|
2021-10-28 01:37:27 -07:00
|
|
|
if (!XIMaskIsSet( event->valuators.mask, i )) continue;
|
|
|
|
if (i == x->number)
|
|
|
|
{
|
|
|
|
+ x_raw = *raw_values;
|
|
|
|
x_value = *values;
|
|
|
|
if (x->mode == XIModeRelative) x->value += x_value * x_scale;
|
|
|
|
else x->value = (x_value - x->min) * x_scale;
|
|
|
|
}
|
|
|
|
if (i == y->number)
|
|
|
|
{
|
|
|
|
+ y_raw = *raw_values;
|
|
|
|
y_value = *values;
|
|
|
|
if (y->mode == XIModeRelative) y->value += y_value * y_scale;
|
|
|
|
else y->value = (y_value - y->min) * y_scale;
|
|
|
|
}
|
|
|
|
+ raw_values++;
|
|
|
|
values++;
|
|
|
|
}
|
|
|
|
|
2023-07-17 18:18:33 -07:00
|
|
|
input->mi.dx = round( x->value );
|
|
|
|
input->mi.dy = round( y->value );
|
2021-10-28 01:37:27 -07:00
|
|
|
|
|
|
|
+ if (x->mode != XIModeAbsolute) rawinput->data.mouse.lLastX = x_raw;
|
2023-07-17 18:18:33 -07:00
|
|
|
+ else rawinput->data.mouse.lLastX = input->mi.dx;
|
2021-10-28 01:37:27 -07:00
|
|
|
+ if (y->mode != XIModeAbsolute) rawinput->data.mouse.lLastY = y_raw;
|
2023-07-17 18:18:33 -07:00
|
|
|
+ else rawinput->data.mouse.lLastY = input->mi.dy;
|
2021-10-28 01:37:27 -07:00
|
|
|
+
|
2022-11-18 16:16:02 -08:00
|
|
|
TRACE( "event %f,%f value %f,%f input %d,%d\n", x_value, y_value, x->value, y->value,
|
2023-07-17 18:18:33 -07:00
|
|
|
(int)input->mi.dx, (int)input->mi.dy );
|
2021-10-28 01:37:27 -07:00
|
|
|
|
2023-07-17 18:18:33 -07:00
|
|
|
@@ -1858,7 +1866,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
|
|
|
|
input.mi.dwExtraInfo = 0;
|
|
|
|
input.mi.dx = 0;
|
|
|
|
input.mi.dy = 0;
|
2021-10-28 01:37:27 -07:00
|
|
|
- if (!map_raw_event_coords( event, &input )) return FALSE;
|
|
|
|
+ if (!map_raw_event_coords( event, &input, &rawinput )) return FALSE;
|
|
|
|
|
|
|
|
if (!thread_data->xi2_rawinput_only)
|
|
|
|
__wine_send_input( 0, &input, NULL );
|
2023-07-17 18:18:33 -07:00
|
|
|
@@ -1872,8 +1880,6 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
|
2021-10-28 01:37:27 -07:00
|
|
|
rawinput.data.mouse.ulRawButtons = 0;
|
2023-07-17 18:18:33 -07:00
|
|
|
rawinput.data.mouse.usButtonData = 0;
|
|
|
|
rawinput.data.mouse.usButtonFlags = 0;
|
|
|
|
- rawinput.data.mouse.lLastX = input.mi.dx;
|
|
|
|
- rawinput.data.mouse.lLastY = input.mi.dy;
|
2021-10-28 01:37:27 -07:00
|
|
|
rawinput.data.mouse.ulExtraInformation = 0;
|
|
|
|
|
|
|
|
input.type = INPUT_HARDWARE;
|
|
|
|
--
|
2023-07-17 18:18:33 -07:00
|
|
|
2.40.1
|
2021-10-28 01:37:27 -07:00
|
|
|
|