diff options
author | Daniel Kurtz <djkurtz@chromium.org> | 2012-04-12 10:11:10 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-04-12 10:11:10 +1000 |
commit | c5a45b0f7658c77725adce2b64a0fbd62f208328 (patch) | |
tree | f330c1008d3d208834b6db12c6bf82a80a7bbb6c /dix/getevents.c | |
parent | 72cfc1a097dc1e09d2cd9415ef7855a2cef92351 (diff) |
dix: don't BUG_WARN for button events from button-only device
Events from button-only devices still need coordinates, and they get them
from scale_to_desktop(). Therefore, a dev without valuators is not a bug.
However, a dev with valuators, but less than two of them still is a bug.
This was noticed when unplugging a "Creative Technology SB Arena Headset",
which has some BTNs and some KEYs, but no REL or ABS valuators.
It emits [BTN_3] = 0 on unplug, which would trigger the BUG_WARN.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix/getevents.c')
-rw-r--r-- | dix/getevents.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dix/getevents.c b/dix/getevents.c index 3093786c3..23bbe065c 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -848,7 +848,7 @@ scale_to_desktop(DeviceIntPtr dev, ValuatorMask *mask, ScreenPtr scr = miPointerGetScreen(dev); double x, y; - BUG_WARN(!dev->valuator || dev->valuator->numAxes < 2); + BUG_WARN(dev->valuator && dev->valuator->numAxes < 2); if (!dev->valuator || dev->valuator->numAxes < 2) { /* if we have no axes, last.valuators must be in screen coords * anyway */ |