summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-09-03 11:54:41 +1000
committerJeremy Huddleston <jeremyhu@apple.com>2011-03-08 21:13:56 -0800
commita200a3cf8613d1c64b26a9149acaaebbdb4cd174 (patch)
treec9adb7067fa6477c229232065099b62f432bb63e
parent39ee5010504ab60737677ae3ec32a927e6d0df5e (diff)
mi: handle DGA subtypes when determining the master device.
The subtype in the DGA event is the core type and all ET_ event types (where applicable) are identical to the core types. Thus the switch statement below will work as required and assign the right master device. Fixes a crasher bug on keyboard devices with valuators. If a device sends a motion event while grabbed and a DGA client is active (but has not selected input through DGA), the valuator event is posted through the VCK and eventually results in a NULL-pointer dereference on dev->valuator. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 31ab9f8860848504df18a8be9d19b817b191e0df)
-rw-r--r--mi/mieq.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mi/mieq.c b/mi/mieq.c
index 9b6d0c901..97f4afcf4 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -320,6 +320,7 @@ CopyGetMasterEvent(DeviceIntPtr sdev,
{
DeviceIntPtr mdev;
int len = original->any.length;
+ int type = original->any.type;
CHECKEVENT(original);
@@ -327,7 +328,12 @@ CopyGetMasterEvent(DeviceIntPtr sdev,
if (!sdev || !sdev->u.master)
return NULL;
- switch(original->any.type)
+#if XFreeXDGA
+ if (type == ET_DGAEvent)
+ type = original->dga_event.subtype;
+#endif
+
+ switch(type)
{
case ET_KeyPress:
case ET_KeyRelease: