From 75dece08fb72803d5116e6776e9f1534ff20e37b Mon Sep 17 00:00:00 2001 From: "Zephaniah E. Hull" Date: Mon, 4 Jun 2007 09:09:20 -0400 Subject: [PATCH] xf86PostMotionEvents[P] calls xf86SendDragEvents, xf86SendDragEvents unconditionally checks device->button->buttonsDown. Let's make it possible to have a device with motion, but no buttons. Without segfaulting. --- hw/xfree86/common/xf86Xinput.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 207e792cf..543002000 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -101,7 +101,7 @@ xf86SendDragEvents(DeviceIntPtr device) { LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate; - if (device->button->buttonsDown > 0) + if (device->button && device->button->buttonsDown > 0) return (local->flags & XI86_SEND_DRAG_EVENTS); else return (TRUE);