changeset 48819:c7fb53597300

(last_mousemove_x, last_mousemove_y): New variables. (w32_read_socket) <WM_MOUSEMOVE>: Use them to detect non-movement. Be more careful about when help_events are generated.
author Jason Rumney <jasonr@gnu.org>
date Thu, 12 Dec 2002 19:55:43 +0000
parents 5030a4c296d2
children 2db5dda201b5
files src/w32term.c
diffstat 1 files changed, 21 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32term.c	Thu Dec 12 17:10:34 2002 +0000
+++ b/src/w32term.c	Thu Dec 12 19:55:43 2002 +0000
@@ -161,9 +161,11 @@
 static Lisp_Object help_echo_object;
 static int help_echo_pos;
 
-/* Temporary variable for w32_read_socket.  */
+/* Temporary variables for w32_read_socket.  */
 
 static Lisp_Object previous_help_echo;
+static int last_mousemove_x = 0;
+static int last_mousemove_y = 0;
 
 /* Non-zero means that a HELP_EVENT has been generated since Emacs
    start.  */
@@ -8766,9 +8768,17 @@
 	  break;
 
 	case WM_MOUSEMOVE:
+	  /* Ignore non-movement.  */
+	  {
+	    int x = LOWORD (msg.msg.lParam);
+	    int y = HIWORD (msg.msg.lParam);
+	    if (x == last_mousemove_x && y == last_mousemove_y)
+	      break;
+	    last_mousemove_x = x;
+	    last_mousemove_y = y;
+	  }
+
           previous_help_echo = help_echo;
-          help_echo_object = help_echo_window = Qnil;
-          help_echo_pos = -1;
 
 	  if (dpyinfo->grabbed && last_mouse_frame
 	      && FRAME_LIVE_P (last_mouse_frame))
@@ -8793,11 +8803,18 @@
 
           /* If the contents of the global variable help_echo
              has changed, generate a HELP_EVENT.  */
-          if (help_echo != previous_help_echo)
+          if (help_echo != previous_help_echo ||
+	      (!NILP (help_echo) && !STRINGP (help_echo) && f->mouse_moved))
             {
               Lisp_Object frame;
               int n;
 
+	      if (help_echo == Qnil)
+		{
+		  help_echo_object = help_echo_window = Qnil;
+		  help_echo_pos = -1;
+		}
+
               if (f)
                 XSETFRAME (frame, f);
               else