changeset 76658:384739d4e5e7

(xt-mouse-epoch): New variable. (xterm-mouse-event): Use float-time.
author Nick Roberts <nickrob@snap.net.nz>
date Wed, 21 Mar 2007 20:41:23 +0000
parents ee5fbf83e732
children 750eeee3d77a
files lisp/xt-mouse.el
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/xt-mouse.el	Wed Mar 21 20:33:26 2007 +0000
+++ b/lisp/xt-mouse.el	Wed Mar 21 20:41:23 2007 +0000
@@ -105,6 +105,8 @@
 (defvar xterm-mouse-y 0
   "Position of last xterm mouse event relative to the frame.")
 
+(defvar xt-mouse-epoch nil)
+
 ;; Indicator for the xterm-mouse mode.
 
 (defun xterm-mouse-position-function (pos)
@@ -125,7 +127,11 @@
 	 (x (- (xterm-mouse-event-read) #o40 1))
 	 (y (- (xterm-mouse-event-read) #o40 1))
 	 (time (current-time))
-	 (timestamp (+ ( * (nth 1 time) 1000 ) (/ (nth 2 time) 1000)))
+	 (timestamp (truncate
+		     (* 1000
+			(- (float-time)
+			   (or xt-mouse-epoch
+			       (setq xt-mouse-epoch (float-time)))))))
 	 (mouse (intern
 		 ;; For buttons > 3, the release-event looks
 		 ;; differently (see xc/programs/xterm/button.c,