[PATCH] dix: put warning in for scroll increments of 0
Peter Hutterer
peter.hutterer at who-t.net
Wed Mar 14 20:46:56 PDT 2012
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 at who-t.net>
---
obviously a stopgap, but I think this is the bug I'm seeing on resume,
every once in a while. Unfortunately, I didn't get more info out of it but
this should at least work around it for now.
dix/getevents.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/dix/getevents.c b/dix/getevents.c
index 3c27aef..8eb8247 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1428,6 +1428,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;
--
1.7.7.6
More information about the xorg-devel
mailing list