summaryrefslogtreecommitdiff
path: root/src/synproto.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-04-30 10:47:14 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-05-01 12:41:09 +1000
commitcc595bd323aab2b0ef7b41fded2f0b5571cf0a8e (patch)
treeedba9f0eb3ee1d8ec7486259183673c15564c088 /src/synproto.c
parente19fff64f76200291c22d6b822bb4e8b06816745 (diff)
Reset all hardware state on DEVICE_OFF (#49161)
Reset all state on DeviceOff to avoid stuck buttons on resume. X.Org Bug 49161 <http://bugs.freedesktop.org/show_bug.cgi?id=49161> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'src/synproto.c')
-rw-r--r--src/synproto.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/synproto.c b/src/synproto.c
index 4f44f4d..cf54c4d 100644
--- a/src/synproto.c
+++ b/src/synproto.c
@@ -134,6 +134,29 @@ SynapticsCopyHwState(struct SynapticsHwState *dst,
}
void
+SynapticsResetHwState(struct SynapticsHwState *hw)
+{
+ hw->millis = 0;
+ hw->x = 0;
+ hw->y = 0;
+ hw->z = 0;
+ hw->cumulative_dx = 0;
+ hw->cumulative_dy = 0;
+ hw->numFingers = 0;
+ hw->fingerWidth = 0;
+
+ hw->left = 0;
+ hw->right = 0;
+ hw->up = 0;
+ hw->down = 0;
+
+ hw->middle = 0;
+ memset(hw->multi, 0, sizeof(hw->multi));
+
+ SynapticsResetTouchHwState(hw);
+}
+
+void
SynapticsResetTouchHwState(struct SynapticsHwState *hw)
{
#ifdef HAVE_MULTITOUCH