Commit 0a939842 authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Add a workaround for XInput support with mouse drivers that don't provide labels.

parent 8168e184
...@@ -286,6 +286,8 @@ static void enable_xinput2(void) ...@@ -286,6 +286,8 @@ static void enable_xinput2(void)
class->number, class->min, class->max, class->resolution, class->mode, class->number, class->min, class->max, class->resolution, class->mode,
XGetAtomName( data->display, class->label )); XGetAtomName( data->display, class->label ));
if (class->label == x11drv_atom( Rel_X ) || class->label == x11drv_atom( Rel_Y )) count++; if (class->label == x11drv_atom( Rel_X ) || class->label == x11drv_atom( Rel_Y )) count++;
/* workaround for drivers that don't provide labels */
if (!class->label && class->number <= 1 && class->mode == XIModeRelative) count++;
} }
if (count < 2) continue; if (count < 2) continue;
TRACE( "Using %u (%s) as core pointer\n", TRACE( "Using %u (%s) as core pointer\n",
...@@ -1526,14 +1528,16 @@ static void X11DRV_RawMotion( XGenericEventCookie *xev ) ...@@ -1526,14 +1528,16 @@ static void X11DRV_RawMotion( XGenericEventCookie *xev )
if (XIMaskIsSet( event->valuators.mask, class->number )) if (XIMaskIsSet( event->valuators.mask, class->number ))
{ {
double val = *values++; double val = *values++;
if (class->label == x11drv_atom( Rel_X )) if (class->label == x11drv_atom( Rel_X ) ||
(!class->label && class->number == 0 && class->mode == XIModeRelative))
{ {
input.u.mi.dx = dx = val; input.u.mi.dx = dx = val;
if (class->min < class->max) if (class->min < class->max)
input.u.mi.dx = val * (virtual_screen_rect.right - virtual_screen_rect.left) input.u.mi.dx = val * (virtual_screen_rect.right - virtual_screen_rect.left)
/ (class->max - class->min); / (class->max - class->min);
} }
else if (class->label == x11drv_atom( Rel_Y )) else if (class->label == x11drv_atom( Rel_Y ) ||
(!class->label && class->number == 1 && class->mode == XIModeRelative))
{ {
input.u.mi.dy = dy = val; input.u.mi.dy = dy = val;
if (class->min < class->max) if (class->min < class->max)
......
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