Bug 247 - perturbed by clit mouse drift
Status:
RESOLVED FIXED
Component:
Core
Version:
1.2.2
Hardware:
PC All
Importance:
P3 normal
Target Milestone:
---
Assignee:
Rob Caelers
URL:
Depends on:
Blocks:
Reported:
Apr 26 2003 04:41:49 UTC
by:
Rob Caelers
Modified:
Apr 26 2003 04:52:11 UTC
| Who | When | What | Removed | Added |
|---|---|---|---|---|
| Rob Caelers | Apr 26 2003 04:52:11 UTC | status | NEW | RESOLVED |
| resolution | FIXED |
Description
Rob Caelers Apr 26 2003 04:41:49 UTC
Debian bug #190802
From: Chung-chieh Shan <ke**@di**.edu>
Many laptop pointer devices "drift" over time. This causes workrave to
detect activity when there is in fact none. The following patch makes
workrave's pointer activity detection less sensitive and take drift into
account, so as to address this problem.
Thank you.
--- ActivityMonitor.cc.orig 2003-03-09 13:28:35.000000000 -0500
+++ ActivityMonitor.cc 2003-04-25 22:19:18.000000000 -0400
@@ -154,17 +154,17 @@
ActivityMonitor::mouse_notify(int x, int y, int wheel_delta)
{
lock.lock();
- int sensitivity =3D 3;
- if ((abs(x - prev_x) >=3D sensitivity || abs(y - prev_y) >=3D sensitivity)
+ const int delta_x =3D x - prev_x;
+ const int delta_y =3D y - prev_y;
+ prev_x =3D x;
+ prev_y =3D y;
+=20=20=20=20=20=20
+ static const int sensitivity =3D 2;
+ if (abs(delta_x) >=3D sensitivity || abs(delta_y) >=3D sensitivity
|| wheel_delta !=3D 0)
{
- int delta_x =3D x - prev_x;
- int delta_y =3D y - prev_y;
-=20=20=20=20=20=20
statistics.total_movement +=3D int(sqrt((double)(delta_x * delta_x +=
delta_y * delta_y)));
=20=20=20=20=20=20=20
- prev_x =3D x;
- prev_y =3D y;
action_notify();
=20
struct timeval now, tv;Comment 1
Rob Caelers Apr 26 2003 04:52:11 UTC
Patch applied.