From 1e95a7df5f2e919ce59c5188d2ad1b30c3ac8595 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 15 Mar 2012 13:46:56 +1000 Subject: [PATCH] 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 Reviewed-by: Keith Packard --- dix/getevents.c | 4 ++++ 1 file changed, 4 insertions(+) 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;