Compare commits

..

3 Commits

Author SHA1 Message Date
Peter Hutterer
e41befa83f evdev 2.8.3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-04-29 09:45:59 +10:00
Peter Hutterer
34619347b7 Map REL_DIAL to horizontal scrolling (#73105)
This was the original behavior introduced in
f77410e1f9 and stayed that way until smooth
scrolling erroneously added it as vertical axis in
b450efdf95. Revert to horizontal scrolling to
restore the previous behaviour - which unbreaks scrolling on Microsoft mice.

This effectively reverts 54a3120e33 too.

X.Org Bug 73105 <http://bugs.freedesktop.org/show_bug.cgi?id=73105>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 16c85cbeac)

Conflicts:
	src/evdev.c
2014-04-29 09:44:34 +10:00
Peter Hutterer
1a031657b9 Fix wheel emulation for absolute device (#68415)
wheel emulation, for some reasons beyond time, got the value from
pEvdev->vals, then set the value back into pEvdev->vals. Alas, that value is
always 0, hence oldValue is zero and the delta is nil.

If we're not in relative (touchpad) mode, store the current value in
old_vals, so they're retrievable for the next event.

X.Org Bug 68415 <http://bugs.freedesktop.org/show_bug.cgi?id=68415>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f6fcad8b10)
2014-04-29 09:43:14 +10:00
3 changed files with 40 additions and 29 deletions

View File

@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-input-evdev],
[2.8.2],
[2.8.3],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-input-evdev])
AC_CONFIG_SRCDIR([Makefile.am])

View File

@@ -97,7 +97,6 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
WheelAxisPtr pAxis = NULL, pOtherAxis = NULL;
int value = pEv->value;
int oldValue;
/* Has wheel emulation been configured to be enabled? */
if (!pEvdev->emulateWheel.enabled)
@@ -118,9 +117,13 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
/* We don't want to intercept real mouse wheel events */
if(pEv->type == EV_ABS) {
int axis = pEvdev->abs_axis_map[pEv->code];
oldValue = valuator_mask_get(pEvdev->vals, axis);
valuator_mask_set(pEvdev->vals, axis, value);
value -= oldValue; /* make value into a differential measurement */
int oldValue;
if (axis > -1 && valuator_mask_fetch(pEvdev->old_vals, axis, &oldValue)) {
valuator_mask_set(pEvdev->vals, axis, value);
value -= oldValue; /* make value into a differential measurement */
} else
value = 0; /* avoid a jump on the first touch */
}
switch(pEv->code) {

View File

@@ -493,31 +493,39 @@ EvdevProcessValuators(InputInfoPtr pInfo)
EvdevPtr pEvdev = pInfo->private;
int *delta = pEvdev->delta;
/* convert to relative motion for touchpads */
if (pEvdev->abs_queued && (pEvdev->flags & EVDEV_RELATIVE_MODE)) {
if (pEvdev->in_proximity) {
if (valuator_mask_isset(pEvdev->vals, 0))
{
if (valuator_mask_isset(pEvdev->old_vals, 0))
delta[REL_X] = valuator_mask_get(pEvdev->vals, 0) -
valuator_mask_get(pEvdev->old_vals, 0);
valuator_mask_set(pEvdev->old_vals, 0,
valuator_mask_get(pEvdev->vals, 0));
}
if (valuator_mask_isset(pEvdev->vals, 1))
{
if (valuator_mask_isset(pEvdev->old_vals, 1))
delta[REL_Y] = valuator_mask_get(pEvdev->vals, 1) -
valuator_mask_get(pEvdev->old_vals, 1);
valuator_mask_set(pEvdev->old_vals, 1,
valuator_mask_get(pEvdev->vals, 1));
if (pEvdev->abs_queued) {
/* convert to relative motion for touchpads */
if (pEvdev->flags & EVDEV_RELATIVE_MODE) {
if (pEvdev->in_proximity) {
if (valuator_mask_isset(pEvdev->vals, 0))
{
if (valuator_mask_isset(pEvdev->old_vals, 0))
delta[REL_X] = valuator_mask_get(pEvdev->vals, 0) -
valuator_mask_get(pEvdev->old_vals, 0);
valuator_mask_set(pEvdev->old_vals, 0,
valuator_mask_get(pEvdev->vals, 0));
}
if (valuator_mask_isset(pEvdev->vals, 1))
{
if (valuator_mask_isset(pEvdev->old_vals, 1))
delta[REL_Y] = valuator_mask_get(pEvdev->vals, 1) -
valuator_mask_get(pEvdev->old_vals, 1);
valuator_mask_set(pEvdev->old_vals, 1,
valuator_mask_get(pEvdev->vals, 1));
}
} else {
valuator_mask_zero(pEvdev->old_vals);
}
valuator_mask_zero(pEvdev->vals);
pEvdev->abs_queued = 0;
pEvdev->rel_queued = 1;
} else {
valuator_mask_zero(pEvdev->old_vals);
int val;
if (valuator_mask_fetch(pEvdev->vals, 0, &val))
valuator_mask_set(pEvdev->old_vals, 0, val);
if (valuator_mask_fetch(pEvdev->vals, 1, &val))
valuator_mask_set(pEvdev->old_vals, 1, val);
}
valuator_mask_zero(pEvdev->vals);
pEvdev->abs_queued = 0;
pEvdev->rel_queued = 1;
}
if (pEvdev->rel_queued) {
@@ -1545,7 +1553,7 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device, int want_scroll_axes)
NO_AXIS_LIMITS, NO_AXIS_LIMITS,
0, 0, 0, Relative);
SetScrollValuator(device, pEvdev->rel_axis_map[idx],
SCROLL_TYPE_VERTICAL, -1.0,
SCROLL_TYPE_HORIZONTAL, 1.0,
SCROLL_FLAG_NONE);
}
}
@@ -1688,7 +1696,7 @@ EvdevAddRelValuatorClass(DeviceIntPtr device)
if (axis == REL_WHEEL)
SetScrollValuator(device, axnum, SCROLL_TYPE_VERTICAL, -1.0, SCROLL_FLAG_PREFERRED);
else if (axis == REL_DIAL)
SetScrollValuator(device, axnum, SCROLL_TYPE_VERTICAL, -1.0, SCROLL_FLAG_NONE);
SetScrollValuator(device, axnum, SCROLL_TYPE_HORIZONTAL, 1.0, SCROLL_FLAG_NONE);
else if (axis == REL_HWHEEL)
SetScrollValuator(device, axnum, SCROLL_TYPE_HORIZONTAL, 1.0, SCROLL_FLAG_NONE);
#endif