chiark / gitweb /
Offsets: Use ymin value for bottom edge features
[xf86-input-mtrack.git] / src / mtstate.c
index 2cc0c326e8304e56ca9ecd3d32dc731d9bd62357..af476efcbe71c222236ce7c49b6e53664a0762ca 100644 (file)
@@ -237,7 +237,7 @@ static void touches_update(struct MTState* ms,
                        else
                                CLEARBIT(ms->touch[n].state, MT_PALM);
                        
-                       if (ms->touch[n].y > (100 - cfg->bottom_edge)*cfg->pad_height/100) {
+                       if ((ms->touch[n].y - get_cap_ymin(caps)) > (100 - cfg->bottom_edge)*cfg->pad_height/100) {
                                if (GETBIT(ms->touch[n].state, MT_NEW))
                                        SETBIT(ms->touch[n].state, MT_BOTTOM_EDGE);
                        }
@@ -286,25 +286,25 @@ static void mtstate_output(const struct MTState* ms,
        foreach_bit(i, ms->touch_used) {
                if (GETBIT(ms->touch[i].state, MT_RELEASED)) {
                        timersub(&hs->evtime, &ms->touch[i].down, &tv);
-                       xf86Msg(X_INFO, "  released p(%d, %d) d(%+d, %+d) dir(%f) down(%llu) time(%lld)\n",
+                       xf86Msg(X_INFO, "  released p(%d, %d) d(%d, %d) dir(%f) down(%llu) state("PRBITMASK") time(%lld)\n",
                                                ms->touch[i].x, ms->touch[i].y, ms->touch[i].dx, ms->touch[i].dy,
-                                               ms->touch[i].direction, timertoms(&ms->touch[i].down), timertoms(&tv));
+                                               ms->touch[i].direction, timertoms(&ms->touch[i].down), ms->touch[i].state, timertoms(&tv));
                }
                else if (GETBIT(ms->touch[i].state, MT_NEW)) {
-                       xf86Msg(X_INFO, "  new      p(%d, %d) d(%+d, %+d) dir(%f) down(%llu)\n",
+                       xf86Msg(X_INFO, "  new      p(%d, %d) d(%d, %d) dir(%f) down(%llu) state("PRBITMASK")\n",
                                                ms->touch[i].x, ms->touch[i].y, ms->touch[i].dx, ms->touch[i].dy,
-                                               ms->touch[i].direction, timertoms(&ms->touch[i].down));
+                                               ms->touch[i].direction, timertoms(&ms->touch[i].down), ms->touch[i].state);
                }
                else if (GETBIT(ms->touch[i].state, MT_INVALID)) {
                        timersub(&hs->evtime, &ms->touch[i].down, &tv);
-                       xf86Msg(X_INFO, "  invalid  p(%d, %d) d(%+d, %+d) dir(%f) down(%llu) time(%lld)\n",
+                       xf86Msg(X_INFO, "  invalid  p(%d, %d) d(%d, %d) dir(%f) down(%llu) state("PRBITMASK") time(%lld)\n",
                                                ms->touch[i].x, ms->touch[i].y, ms->touch[i].dx, ms->touch[i].dy,
-                                               ms->touch[i].direction, timertoms(&ms->touch[i].down), timertoms(&tv));
+                                               ms->touch[i].direction, timertoms(&ms->touch[i].down), ms->touch[i].state, timertoms(&tv));
                }
                else {
-                       xf86Msg(X_INFO, "  touching p(%d, %d) d(%+d, %+d) dir(%f) down(%llu)\n",
+                       xf86Msg(X_INFO, "  touching p(%d, %d) d(%d, %d) dir(%f) down(%llu) state("PRBITMASK")\n",
                                                ms->touch[i].x, ms->touch[i].y, ms->touch[i].dx, ms->touch[i].dy,
-                                               ms->touch[i].direction, timertoms(&ms->touch[i].down));
+                                               ms->touch[i].direction, timertoms(&ms->touch[i].down), ms->touch[i].state);
                }
        }
 }