From 48a58a62c0ecc642d5636f60075c72cf6c45f5f8 Mon Sep 17 00:00:00 2001
From: Greg Alexander <gitgreg@galexander.org>
Date: Thu, 28 Feb 2013 00:37:07 -0500
Subject: [PATCH 1/3] enable is_palm() detection for pressure touchpads

---
 src/mtstate.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mtstate.c b/src/mtstate.c
index 2cc0c32..553795a 100644
--- a/src/mtstate.c
+++ b/src/mtstate.c
@@ -93,10 +93,16 @@ static int is_thumb(const struct MConfig* cfg,
 static int is_palm(const struct MConfig* cfg,
 			const struct FingerState* hw)
 {
-	if (cfg->touch_type != MCFG_SCALE && cfg->touch_type != MCFG_SIZE)
+	int size;
+	if ((cfg->touch_type == MCFG_SCALE) || (cfg->touch_type == MCFG_SIZE)) {
+		size = hw->touch_major;
+	} else if (cfg->touch_type == MCFG_PRESSURE) {
+		size = hw->pressure;
+	} else {
 		return 0;
+	}
 
-	int size = touch_range_ratio(cfg, hw->touch_major);
+	size = touch_range_ratio(cfg, size);
 	if (size > cfg->palm_size) {
 #if DEBUG_MTSTATE
 		xf86Msg(X_INFO, "is_palm: yes %d > %d\n", size, cfg->palm_size);
-- 
1.7.10.4

