2021-04-09 15:39:38 -07:00
|
|
|
From fff35d809015ea53a7195122482e80a2dd366b9e Mon Sep 17 00:00:00 2001
|
2019-12-23 01:03:44 -08:00
|
|
|
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
|
|
|
Date: Tue, 10 Sep 2019 12:24:22 +0200
|
2020-06-30 15:30:13 -07:00
|
|
|
Subject: [PATCH] winex11.drv: Send relative RawMotion events unprocessed.
|
2019-12-23 01:03:44 -08: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.
|
|
|
|
---
|
2021-04-09 15:39:38 -07:00
|
|
|
dlls/winex11.drv/mouse.c | 16 +++++++++++-----
|
|
|
|
1 file changed, 11 insertions(+), 5 deletions(-)
|
2019-12-23 01:03:44 -08:00
|
|
|
|
|
|
|
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
|
2021-04-09 15:39:38 -07:00
|
|
|
index dcc9fe82fd1..44e9786cd9f 100644
|
2019-12-23 01:03:44 -08:00
|
|
|
--- a/dlls/winex11.drv/mouse.c
|
|
|
|
+++ b/dlls/winex11.drv/mouse.c
|
2021-04-09 15:39:38 -07:00
|
|
|
@@ -1953,21 +1953,18 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
|
2019-12-23 01:03:44 -08:00
|
|
|
{
|
|
|
|
XIRawEvent *event = xev->data;
|
|
|
|
const double *values = event->valuators.values;
|
|
|
|
+ const double *raw_values = event->raw_values;
|
|
|
|
RECT virtual_rect;
|
2021-04-09 15:39:38 -07:00
|
|
|
RAWINPUT rawinput;
|
2019-12-23 01:03:44 -08:00
|
|
|
INPUT input;
|
|
|
|
int i;
|
|
|
|
double dx = 0, dy = 0, val;
|
|
|
|
+ double raw_dx = 0, raw_dy = 0, raw_val;
|
|
|
|
double x_scale = 1, y_scale = 1;
|
|
|
|
struct x11drv_thread_data *thread_data = x11drv_thread_data();
|
|
|
|
XIValuatorClassInfo *x_pos, *y_pos;
|
|
|
|
|
|
|
|
if (thread_data->x_pos_valuator.number < 0 || thread_data->y_pos_valuator.number < 0) return FALSE;
|
|
|
|
- if (thread_data->x_pos_valuator.mode != thread_data->y_pos_valuator.mode)
|
|
|
|
- {
|
|
|
|
- FIXME("Unsupported relative/absolute X/Y axis mismatch\n.");
|
|
|
|
- return FALSE;
|
|
|
|
- }
|
|
|
|
if (!event->valuators.mask_len) return FALSE;
|
|
|
|
if (thread_data->xi2_state != xi_enabled) return FALSE;
|
|
|
|
if (event->deviceid != thread_data->xi2_core_pointer) return FALSE;
|
2021-04-09 15:39:38 -07:00
|
|
|
@@ -1995,9 +1992,11 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
|
2019-12-23 01:03:44 -08:00
|
|
|
{
|
|
|
|
if (!XIMaskIsSet( event->valuators.mask, i )) continue;
|
|
|
|
val = *values++;
|
|
|
|
+ raw_val = *raw_values++;
|
|
|
|
if (i == x_pos->number)
|
|
|
|
{
|
|
|
|
dx = val;
|
|
|
|
+ raw_dx = raw_val;
|
|
|
|
input.u.mi.dwFlags |= (x_pos->mode == XIModeAbsolute ? MOUSEEVENTF_ABSOLUTE : 0);
|
|
|
|
if (x_pos->mode == XIModeAbsolute)
|
|
|
|
input.u.mi.dx = (dx - x_pos->min) * x_scale;
|
2021-04-09 15:39:38 -07:00
|
|
|
@@ -2007,6 +2006,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
|
2019-12-23 01:03:44 -08:00
|
|
|
if (i == y_pos->number)
|
|
|
|
{
|
|
|
|
dy = val;
|
|
|
|
+ raw_dy = raw_val;
|
|
|
|
input.u.mi.dwFlags |= (y_pos->mode == XIModeAbsolute ? MOUSEEVENTF_ABSOLUTE : 0);
|
|
|
|
if (y_pos->mode == XIModeAbsolute)
|
|
|
|
input.u.mi.dy = (dy - y_pos->min) * y_scale;
|
2021-04-09 15:39:38 -07:00
|
|
|
@@ -2028,6 +2028,12 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
|
2019-12-23 01:03:44 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-09 15:39:38 -07:00
|
|
|
+ if (x_pos->mode != XIModeAbsolute)
|
|
|
|
+ {
|
|
|
|
+ input.u.mi.dx = raw_dx;
|
|
|
|
+ input.u.mi.dy = raw_dy;
|
|
|
|
+ }
|
|
|
|
+
|
2019-12-23 01:03:44 -08:00
|
|
|
TRACE( "raw pos %d,%d (event %f,%f)\n", input.u.mi.dx, input.u.mi.dy, dx, dy );
|
2021-04-09 15:39:38 -07:00
|
|
|
|
|
|
|
rawinput.header.dwType = RIM_TYPEMOUSE;
|
2019-12-23 01:03:44 -08:00
|
|
|
--
|
2021-04-09 15:39:38 -07:00
|
|
|
2.30.2
|
2019-12-23 01:03:44 -08:00
|
|
|
|