aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-04-18 16:25:54 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-04-18 16:27:52 +0200
commitd556fa17321040e2813582a0231c1c8328f964eb (patch)
treea324efa957e8e6af1d75b11b1a049cdaba62b706 /src
parentffe299eaea8a7295228701205c9286cc66e9ab0f (diff)
downloadxorg-input-kobomultitouch-d556fa17321040e2813582a0231c1c8328f964eb.tar.gz
xorg-input-kobomultitouch-d556fa17321040e2813582a0231c1c8328f964eb.tar.bz2
xorg-input-kobomultitouch-d556fa17321040e2813582a0231c1c8328f964eb.zip
Only emit multi-finger button events for real button events
The current implementation will emit additional multi-finger click events if, for instance, one finger is removed before releasing the button. This patch makes sure logical buttons events are only emitted as a result of a real button event. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src')
-rw-r--r--src/gestures.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gestures.c b/src/gestures.c
index 36d49f4..7346043 100644
--- a/src/gestures.c
+++ b/src/gestures.c
@@ -159,15 +159,19 @@ static void extract_buttons(struct Gestures *gs, struct MTouch* mt)
if (mt->mem.npoint == 3)
btdata = BITMASK(MT_BUTTON_MIDDLE);
}
- gs->btmask = (btdata ^ mt->mem.btdata) & BITONES(DIM_BUTTON);
- gs->btdata = btdata;
- mt->mem.btdata = btdata;
+ if (mt->state.button != mt->prev_state.button) {
+ gs->btmask = (btdata ^ mt->mem.btdata) & BITONES(DIM_BUTTON);
+ gs->btdata = btdata;
+ mt->mem.btdata = btdata;
+ }
}
/******************************************************/
static void extract_type(struct Gestures *gs, struct MTouch* mt)
{
+ if (gs->btmask)
+ SETBIT(gs->type, GS_BUTTON);
if (gs->dx || gs->dy) {
if (mt->mem.npoint == 1)
SETBIT(gs->type, GS_MOVE);