summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-09-17 18:14:33 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2009-09-20 20:45:24 +1000
commitded35b7bf7a5ad27de152476c657a56a4f232800 (patch)
tree7a8c59e80cf4fcfce43dad2feac94f3661502d3c /hw
parent54f15a414130f89832b5c2604b0b44e7e4c6709f (diff)
xf86Xinput.c: get DIX event queue pointer once at InitInput time
The DIX event queue is allocated before InitInput is called, so fetch the pointer there and not randomly at other times. This avoids failing to fetch the pointer sometimes during server regen and then smashing memory through the stale pointer from the previous server generation. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/common/xf86Init.c2
-rw-r--r--hw/xfree86/common/xf86Xinput.c9
2 files changed, 2 insertions, 9 deletions
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 1242de97d..c9baff3ef 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1112,6 +1112,8 @@ InitInput(int argc, char **argv)
mieqInit();
+ GetEventList(&xf86Events);
+
/* Call the PreInit function for each input device instance. */
for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) {
/* Replace obsolete keyboard driver with kbd */
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 974b30e80..b36953700 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -283,11 +283,6 @@ xf86ProcessCommonOptions(LocalDevicePtr local,
/* Backwards compatibility. */
local->history_size = GetMotionHistorySize();
- /* Preallocate xEvent store */
- if (!xf86Events)
- GetEventList(&xf86Events);
- if (!xf86Events)
- FatalError("Couldn't allocate event store\n");
}
/***********************************************************************
@@ -769,7 +764,6 @@ xf86PostMotionEventP(DeviceIntPtr device,
}
#endif
- GetEventList(&xf86Events);
nevents = GetPointerEvents(xf86Events, device, MotionNotify, 0,
flags, first_valuator, num_valuators,
valuators);
@@ -819,7 +813,6 @@ xf86PostProximityEventP(DeviceIntPtr device,
XI_VERIFY_VALUATORS(num_valuators);
- GetEventList(&xf86Events);
nevents = GetProximityEvents(xf86Events, device,
is_in ? ProximityIn : ProximityOut,
first_valuator, num_valuators, valuators);
@@ -881,7 +874,6 @@ xf86PostButtonEventP(DeviceIntPtr device,
}
#endif
- GetEventList(&xf86Events);
nevents = GetPointerEvents(xf86Events, device,
is_down ? ButtonPress : ButtonRelease, button,
flags, first_valuator, num_valuators, valuators);
@@ -940,7 +932,6 @@ xf86PostKeyEventP(DeviceIntPtr device,
XI_VERIFY_VALUATORS(num_valuators);
if (is_absolute) {
- GetEventList(&xf86Events);
nevents = GetKeyboardValuatorEvents(xf86Events, device,
is_down ? KeyPress : KeyRelease,
key_code, first_valuator,