aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-05-12 13:30:05 -0700
committerPaul Eggert2011-05-12 13:30:05 -0700
commitf6a24d19906993b975e7be822abbb3cfce719751 (patch)
tree65904cbfb3740b10318aeed84d41cde7a8e8ccdc /src
parent08dc5ae68e9c699410256ca9052bd09f336ac87f (diff)
downloademacs-f6a24d19906993b975e7be822abbb3cfce719751.tar.gz
emacs-f6a24d19906993b975e7be822abbb3cfce719751.zip
* term.c (term_mouse_position): Don't assume time_t wraparound.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/term.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a772106c521..21c03ba8220 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,7 @@
12011-05-12 Paul Eggert <eggert@cs.ucla.edu> 12011-05-12 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * term.c (term_mouse_position): Don't assume time_t wraparound.
4
3 Be more systematic about user-interface timestamps. 5 Be more systematic about user-interface timestamps.
4 Before, the code sometimes used 'Time', sometimes 'unsigned long', 6 Before, the code sometimes used 'Time', sometimes 'unsigned long',
5 and sometimes 'EMACS_UINT', to represent these timestamps. This 7 and sometimes 'EMACS_UINT', to represent these timestamps. This
@@ -14,6 +16,7 @@
14 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise. 16 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15 * menu.h (xmenu_show): Likewise. 17 * menu.h (xmenu_show): Likewise.
16 * term.c (term_mouse_position): Likewise. 18 * term.c (term_mouse_position): Likewise.
19
17 * termhooks.h (struct input_event.timestamp): Likewise. 20 * termhooks.h (struct input_event.timestamp): Likewise.
18 (struct terminal.mouse_position_hook): Likewise. 21 (struct terminal.mouse_position_hook): Likewise.
19 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise. 22 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
diff --git a/src/term.c b/src/term.c
index 34320a1ad6d..5fe258caa29 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2701,6 +2701,7 @@ term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
2701 Lisp_Object *y, Time *timeptr) 2701 Lisp_Object *y, Time *timeptr)
2702{ 2702{
2703 struct timeval now; 2703 struct timeval now;
2704 Time sec, usec;
2704 2705
2705 *fp = SELECTED_FRAME (); 2706 *fp = SELECTED_FRAME ();
2706 (*fp)->mouse_moved = 0; 2707 (*fp)->mouse_moved = 0;
@@ -2711,7 +2712,9 @@ term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
2711 XSETINT (*x, last_mouse_x); 2712 XSETINT (*x, last_mouse_x);
2712 XSETINT (*y, last_mouse_y); 2713 XSETINT (*y, last_mouse_y);
2713 gettimeofday(&now, 0); 2714 gettimeofday(&now, 0);
2714 *timeptr = (now.tv_sec * 1000) + (now.tv_usec / 1000); 2715 sec = now.tv_sec;
2716 usec = now.tv_usec;
2717 *timeptr = (sec * 1000) + (usec / 1000);
2715} 2718}
2716 2719
2717/* Prepare a mouse-event in *RESULT for placement in the input queue. 2720/* Prepare a mouse-event in *RESULT for placement in the input queue.