aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/devices.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/devices.c')
-rw-r--r--xorg-server/dix/devices.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index b6f7ea697..73c4d1460 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -264,6 +264,8 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
offsetof(DeviceIntRec, devPrivates), PRIVATE_DEVICE);
if (!dev)
return (DeviceIntPtr)NULL;
+
+ dev->last.scroll = NULL;
dev->id = devid;
dev->public.processInputProc = ProcessOtherEvent;
dev->public.realInputProc = ProcessOtherEvent;
@@ -943,6 +945,7 @@ CloseDevice(DeviceIntPtr dev)
free(dev->deviceGrab.sync.event);
free(dev->config_info); /* Allocated in xf86ActivateDevice. */
+ free(dev->last.scroll);
dev->config_info = NULL;
dixFreeObjectWithPrivates(dev, PRIVATE_DEVICE);
}
@@ -1285,10 +1288,19 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels,
if (!valc)
return FALSE;
+ dev->last.scroll = valuator_mask_new(numAxes);
+ if (!dev->last.scroll)
+ {
+ free(valc);
+ return FALSE;
+ }
+
valc->sourceid = dev->id;
valc->motion = NULL;
valc->first_motion = 0;
valc->last_motion = 0;
+ valc->h_scroll_axis = -1;
+ valc->v_scroll_axis = -1;
valc->numMotionEvents = numMotionEvents;
valc->motionHintWindow = NullWindow;