summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/synaptics.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index a455b6f..181e88a 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1974,6 +1974,14 @@ get_delta(SynapticsPrivate *priv, const struct SynapticsHwState *hw,
/* report edge speed as synthetic motion. Of course, it would be
* cooler to report floats than to buffer, but anyway. */
+
+ /* FIXME: When these values go NaN, bad things happen. Root cause is unknown
+ * thus far though. */
+ if (isnan(priv->frac_x))
+ priv->frac_x = 0;
+ if (isnan(priv->frac_y))
+ priv->frac_y = 0;
+
tmpf = *dx + x_edge_speed * dtime + priv->frac_x;
priv->frac_x = modf(tmpf, &integral);
*dx = integral;