summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2011-11-09 08:59:58 -0800
committerJason Gerecke <killertofu@gmail.com>2011-11-14 16:09:29 -0800
commitef47fa044b6bc3949c0b8d96c665d18937da719b (patch)
treecb1472b5b46976cd81dffdd59ef3d6ed5886f1a0
parent882795767a975854f373d58a9b15a57dfa244f28 (diff)
Revert "Only convert I4 tilt bits to rotation for the I4 mouse"
This reverts commit 9be9719d78af035c45ea4b191c21fab0ee54f198. Under the right conditions, the 'tool' pointer can be NULL, leading to the X server crashing. An easy way to trigger the crash is to spam pad events (such as button presses) while holding the stylus on the edge of proximity. Rather than fix this with additional checks for NULL, Ping clued me into a much more elegant (and bug-free) way to implement the check for an I4 mouse. See next patch. Signed-off-by: Jason Gerecke <killertofu@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/wcmCommon.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index 6b25101..ee138ba 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -59,8 +59,6 @@ static void commonDispatchDevice(WacomCommonPtr common,
enum WacomSuppressMode suppress);
static void sendAButton(InputInfoPtr pInfo, int button, int mask,
int first_val, int num_vals, int *valuators);
-static WacomToolPtr findTool(const WacomCommonPtr common,
- const WacomDeviceState *ds);
/*****************************************************************************
* Utility functions
@@ -905,16 +903,11 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel,
if (TabletHasFeature(common, WCM_ROTATION) &&
TabletHasFeature(common, WCM_RING)) /* I4 */
{
- WacomToolPtr tool = findTool(common, &ds);
- WacomDevicePtr toolpriv = tool->device->private;
- if (tool && tool->device && IsCursor(toolpriv))
- {
- /* convert Intuos4 mouse tilt to rotation */
- ds.rotation = wcmTilt2R(ds.tiltx, ds.tilty,
- INTUOS4_CURSOR_ROTATION_OFFSET);
- ds.tiltx = 0;
- ds.tilty = 0;
- }
+ /* convert Intuos4 mouse tilt to rotation */
+ ds.rotation = wcmTilt2R(ds.tiltx, ds.tilty,
+ INTUOS4_CURSOR_ROTATION_OFFSET);
+ ds.tiltx = 0;
+ ds.tilty = 0;
}
/* Optionally filter values only while in proximity */