dix: fix wheel emulation lockup when a negative increment is set
The increment sign wasn't taking into account when checking if the next
value is past our current value. The result was that for negative
increments, we kept looping indefinitely, locking up the server.
Easiest to reproduce with the evdev driver which has a negative
increment on the y axis.
Fixes 0a22502c34
dix: switch scroll button emulation to multiples of increment
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
0a22502c34
commit
d2158d4063
|
@ -1607,8 +1607,8 @@ emulate_scroll_button_events(InternalEvent *events,
|
|||
/* The next value we want to send out a button event for */
|
||||
double next_val = last_scroll_val + direction * incr;
|
||||
|
||||
if ((direction > 0 && next_val > current_val) ||
|
||||
(direction < 0 && next_val < current_val))
|
||||
if ((((direction > 0 && incr > 0) || (direction < 0 && incr < 0)) && (next_val > current_val)) ||
|
||||
(((direction > 0 && incr < 0) || (direction < 0 && incr > 0)) && (next_val < current_val)))
|
||||
break;
|
||||
|
||||
/* fill_pointer_events() generates four events: one normal and one raw
|
||||
|
|
Loading…
Reference in New Issue