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

This commit is contained in:
Alexandre Julliard 2012-09-25 19:25:02 +02:00
parent 8168e18443
commit 0a9398421c
1 changed files with 6 additions and 2 deletions

View File

@ -286,6 +286,8 @@ static void enable_xinput2(void)
class->number, class->min, class->max, class->resolution, class->mode,
XGetAtomName( data->display, class->label ));
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;
TRACE( "Using %u (%s) as core pointer\n",
@ -1526,14 +1528,16 @@ static void X11DRV_RawMotion( XGenericEventCookie *xev )
if (XIMaskIsSet( event->valuators.mask, class->number ))
{
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;
if (class->min < class->max)
input.u.mi.dx = val * (virtual_screen_rect.right - virtual_screen_rect.left)
/ (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;
if (class->min < class->max)