Commit e268b36c authored by Rémi Bernon's avatar Rémi Bernon Committed by Vitaly Lipatov

winex11.drv: Send relative RawMotion events unprocessed.

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.
parent dd8548b8
......@@ -1971,12 +1971,12 @@ static BOOL X11DRV_DeviceChanged( XGenericEventCookie *xev )
return TRUE;
}
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;
......@@ -2005,33 +2005,35 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
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++;
}
input->u.mi.dx = round( x->value );
input->u.mi.dy = round( y->value );
if (x->mode != XIModeAbsolute) rawinput->data.mouse.lLastX = x_raw;
else rawinput->data.mouse.lLastX = input->u.mi.dx;
if (y->mode != XIModeAbsolute) rawinput->data.mouse.lLastY = y_raw;
else rawinput->data.mouse.lLastY = input->u.mi.dy;
TRACE( "event %f,%f value %f,%f input %d,%d\n", x_value, y_value, x->value, y->value, input->u.mi.dx, input->u.mi.dy );
x->value -= input->u.mi.dx;
y->value -= input->u.mi.dy;
if (!(input->u.mi.dwFlags & MOUSEEVENTF_ABSOLUTE) && !input->u.mi.dx && !input->u.mi.dy)
{
TRACE( "accumulating motion\n" );
return FALSE;
}
return TRUE;
}
......@@ -2058,7 +2060,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
input.u.mi.dwExtraInfo = 0;
input.u.mi.dx = 0;
input.u.mi.dy = 0;
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 );
......@@ -2072,8 +2074,6 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
rawinput.data.mouse.ulRawButtons = 0;
rawinput.data.mouse.u.usButtonData = 0;
rawinput.data.mouse.u.usButtonFlags = 0;
rawinput.data.mouse.lLastX = input.u.mi.dx;
rawinput.data.mouse.lLastY = input.u.mi.dy;
rawinput.data.mouse.ulExtraInformation = 0;
input.type = INPUT_HARDWARE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment