Thinkpad x61 tablet で、Xorg 1.7 以降、XInput の使い方が変わった関係で、新しい方( xf86-input-wacom )を使う事になった。で、使えてはいるんですが、touch を有効にした状態で stylus を使うと一定以上筆圧をかけたときに、ポインタが飛ぶという問題が発生した。
DebugLevel を 12 に設定して、ログを追いかけると、ポインタが飛ぶタイミングで、touch のイベントが起きていました。どうも、ちゃんとデータの parse ができていない模様。なんですが、実装が正しいのか間違っているのかがわからず( この個所は以前からほとんど変わりが無い )、問題の切り分けができていない。
というわけで、アドホックに、stylus を使っている時は、touch のイベントを無視するように src/wcmISDV4.c を修正して回避した( パッチ対象は 2010.1.20 21:00:00 現在の trunk )。
--- src/wcmISDV4.c.orig 2010-01-20 21:59:41.038532466 +0900
+++ src/wcmISDV4.c 2010-01-20 22:00:25.529773107 +0900
@@ -401,6 +401,8 @@
WacomDeviceState* ds;
int n, cur_type, channel = 0;
+ static int isInStylus = 0;
+
DBG(10, common, "\n");
/* determine the type of message (touch or stylus) */
@@ -443,6 +445,8 @@
if (common->wcmPktLength != WACOM_PKGLEN_TPCPEN) /* a touch */
{
+ if (isInStylus == 1) return common->wcmPktLength;
+
ds->x = (((int)data[1]) << 7) | ((int)data[2]);
ds->y = (((int)data[3]) << 7) | ((int)data[4]);
if (common->wcmPktLength == WACOM_PKGLEN_TOUCH9A)
@@ -500,6 +504,16 @@
/* pressure */
ds->pressure = (((data[6] & 0x07) << 7) | data[5] );
+ if (ds->pressure > 0) {
+ // stylus set ground
+ if (isInStylus == 0) {
+ isInStylus = 1;
+ }
+ } else {
+ // in/out proximity
+ isInStylus = 0;
+ }
+
/* buttons */
ds->buttons = (data[0] & 0x07);