diff --git a/include/common.h b/include/common.h index 1021067..b774ead 100644 --- a/include/common.h +++ b/include/common.h @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -51,6 +52,7 @@ typedef unsigned int bitmask_t; #define SETBIT(m, x) (m |= BITMASK(x)) #define CLEARBIT(m, x) (m &= ~BITMASK(x)) #define MODBIT(m, x, b) ((b) ? SETBIT(m, x) : CLEARBIT(m, x)) +#define PRBITMASK "0x%x" #define ABSVAL(x) ((x) < 0 ? -1*(x) : (x)) #define MINVAL(x, y) ((x) < (y) ? (x) : (y)) diff --git a/src/mtstate.c b/src/mtstate.c index 2cc0c32..bd9a7e3 100644 --- a/src/mtstate.c +++ b/src/mtstate.c @@ -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); } } } diff --git a/tools/mtrack-test.c b/tools/mtrack-test.c index 2f455a4..88ed60b 100644 --- a/tools/mtrack-test.c +++ b/tools/mtrack-test.c @@ -23,6 +23,7 @@ #include "mtouch.h" #include #include +#include void xf86Msg(int type, const char *format, ...) {