Commit f6a24d19 authored by Paul Eggert's avatar Paul Eggert

* term.c (term_mouse_position): Don't assume time_t wraparound.

parent 08dc5ae6
2011-05-12 Paul Eggert <eggert@cs.ucla.edu>
* term.c (term_mouse_position): Don't assume time_t wraparound.
Be more systematic about user-interface timestamps.
Before, the code sometimes used 'Time', sometimes 'unsigned long',
and sometimes 'EMACS_UINT', to represent these timestamps. This
......@@ -14,6 +16,7 @@
* menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
* menu.h (xmenu_show): Likewise.
* term.c (term_mouse_position): Likewise.
* termhooks.h (struct input_event.timestamp): Likewise.
(struct terminal.mouse_position_hook): Likewise.
* xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
......
......@@ -2701,6 +2701,7 @@ term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
Lisp_Object *y, Time *timeptr)
{
struct timeval now;
Time sec, usec;
*fp = SELECTED_FRAME ();
(*fp)->mouse_moved = 0;
......@@ -2711,7 +2712,9 @@ term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
XSETINT (*x, last_mouse_x);
XSETINT (*y, last_mouse_y);
gettimeofday(&now, 0);
*timeptr = (now.tv_sec * 1000) + (now.tv_usec / 1000);
sec = now.tv_sec;
usec = now.tv_usec;
*timeptr = (sec * 1000) + (usec / 1000);
}
/* Prepare a mouse-event in *RESULT for placement in the input queue.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment