dix: put warning in for scroll increments of 0

If the increment is 0 but this is a scroll axis, it's definitely a bug.
Nonetheless, it has happened, so put a warning in and a return statement
that we avoid the infinite loop and hopefully be able to reproduce later.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Peter Hutterer 2012-03-15 13:46:56 +10:00 committed by Adam Jackson
parent 63efa2e7e9
commit 1e95a7df5f

View File

@ -1540,6 +1540,10 @@ emulate_scroll_button_events(InternalEvent *events,
ax = &dev->valuator->axes[axis];
incr = ax->scroll.increment;
BUG_WARN_MSG(incr == 0, "for device %s\n", dev->name);
if (incr == 0)
return 0;
if (type != ButtonPress && type != ButtonRelease)
flags |= POINTER_EMULATED;