[PATCH] dix: don't BUG_WARN for button events from button-only device

Chase Douglas chase.douglas at canonical.com
Thu Mar 29 10:23:32 PDT 2012


On 03/29/2012 01:27 AM, Daniel Kurtz wrote:
> Events from button-only devices still need coordinates, and they get them
> from scale_to_desktop().  This isn't a bug, so don't BUG_WARN(), which
> just fills up the log with Backtraces...
> 
> This was noticed when unplugging a "Creative Technology SB Arena Headset",
> which emits [BTN_3] = 0 on unplug.
> 
> Signed-off-by: Daniel Kurtz <djkurtz at chromium.org>
> ---
>  dix/getevents.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/dix/getevents.c b/dix/getevents.c
> index 3093786..ca9427c 100644
> --- a/dix/getevents.c
> +++ b/dix/getevents.c
> @@ -848,7 +848,6 @@ scale_to_desktop(DeviceIntPtr dev, ValuatorMask *mask,
>      ScreenPtr scr = miPointerGetScreen(dev);
>      double x, y;
>  
> -    BUG_WARN(!dev->valuator || dev->valuator->numAxes < 2);

I assume this device does not have any valuators. We still want to
BUG_WARN when there are valuators but the number of axes is less than
two, right? So we should replace this with:

BUG_WARN(dev->valuator && dev->valuator->numAxes < 2);

-- Chase


More information about the xorg-devel mailing list