[PATCH synaptics] syndaemon: reset idle time if the system time has changed (#31968)

Peter Hutterer peter.hutterer at who-t.net
Mon Feb 7 17:55:21 PST 2011


If the system time is changed backwards while the touchpad is disabled
through syndaemon it remains disabled until the time catches up with the
previous idle time again. Avoid this by resetting last_activity with a time
that will trigger re-enabling of the device.

X.Org Bug 31968 <http://bugs.freedesktop.org/show_bug.cgi?id=31968>

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 tools/syndaemon.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/syndaemon.c b/tools/syndaemon.c
index 944c34e..9779935 100644
--- a/tools/syndaemon.c
+++ b/tools/syndaemon.c
@@ -227,6 +227,11 @@ main_loop(Display *display, double idle_time, int poll_delay)
 	if (keyboard_activity(display))
 	    last_activity = current_time;
 
+	/* If system times goes backwards, touchpad can get locked. Make
+	 * sure our last activity wasn't in the future and reset if it was. */
+	if (last_activity > current_time)
+	    last_activity = current_time - idle_time - 1;
+
 	if (current_time > last_activity + idle_time) {	/* Enable touchpad */
 	    toggle_touchpad(True);
 	} else {			    /* Disable touchpad */
-- 
1.7.3.5



More information about the xorg-devel mailing list