diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-03-15 13:46:56 +1000 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2015-09-23 10:51:45 -0400 |
commit | 1e95a7df5f2e919ce59c5188d2ad1b30c3ac8595 (patch) | |
tree | 130fed415f69120cd2c6d5e940df90bf9303f49d /dix/getevents.c | |
parent | 63efa2e7e91349dfecc849d30c5de84b3c911fe9 (diff) |
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>
Diffstat (limited to 'dix/getevents.c')
-rw-r--r-- | dix/getevents.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/dix/getevents.c b/dix/getevents.c index fa5890eec..7ebddc419 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -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; |