Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscellaneous fixes #109

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <xf86Xinput.h>
#include <errno.h>
#include <mtdev-mapping.h>
#include <mtdev-plumbing.h>
#include <stdint.h>
#include <sys/time.h>

Expand All @@ -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))
Expand Down
16 changes: 8 additions & 8 deletions src/mtstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions tools/mtrack-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "mtouch.h"
#include <fcntl.h>
#include <stdarg.h>
#include <unistd.h>

void xf86Msg(int type, const char *format, ...)
{
Expand Down