changeset 10274:83aaf59dabbe

(XTupdate_begin): Fix backward test in previous change. (x_display_box_cursor): Don't redraw old cursor spot in mouse face if cursor was on a newline. (XTread_socket): Handle button events from outside the frame, received due to grabbing the mouse with a button.
author Richard M. Stallman <rms@gnu.org>
date Tue, 27 Dec 1994 21:45:06 +0000
parents b53a669d2413
children 0231c0d38918
files src/xterm.c
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Tue Dec 27 20:14:13 1994 +0000
+++ b/src/xterm.c	Tue Dec 27 21:45:06 1994 +0000
@@ -294,7 +294,7 @@
 
       /* If the frame needs to be redrawn,
 	 simply forget about any prior mouse highlighting.  */
-      if (! FRAME_GARBAGED_P (f))
+      if (FRAME_GARBAGED_P (f))
 	FRAME_X_DISPLAY_INFO (f)->mouse_face_window = Qnil;
 
       if (!NILP (FRAME_X_DISPLAY_INFO (f)->mouse_face_window))
@@ -3892,7 +3892,12 @@
 
 		bzero (&compose_status, sizeof (compose_status));
 
-		f = x_window_to_frame (event.xbutton.window);
+		if (dpyinfo->grabbed && last_mouse_frame
+		    && FRAME_LIVE_P (last_mouse_frame))
+		  f = last_mouse_frame;
+		else
+		  f = x_window_to_frame (event.xmotion.window);
+
 		if (f)
 		  {
 		    if (!x_focus_frame || (f == x_focus_frame))
@@ -4163,6 +4168,7 @@
 	      && (f != x_highlight_frame))))
     {
       int mouse_face_here = 0;
+      struct frame_glyphs *active_glyphs = FRAME_CURRENT_GLYPHS (f);
 
       /* If the cursor is in the mouse face area, redisplay that when
 	 we clear the cursor.  */
@@ -4174,7 +4180,11 @@
 	  &&
 	  (f->phys_cursor_y < FRAME_X_DISPLAY_INFO (f)->mouse_face_end_row
 	   || (f->phys_cursor_y == FRAME_X_DISPLAY_INFO (f)->mouse_face_end_row
-	       && f->phys_cursor_x < FRAME_X_DISPLAY_INFO (f)->mouse_face_end_col)))
+	       && f->phys_cursor_x < FRAME_X_DISPLAY_INFO (f)->mouse_face_end_col))
+	  /* Don't redraw the cursor's spot in mouse face
+	     if it is at the end of a line (on a newline).
+	     The cursor appears there, but mouse highlighting does not.  */
+	  && active_glyphs->used[f->phys_cursor_y] > f->phys_cursor_x)
 	mouse_face_here = 1;
 
       /* If the font is not as tall as a whole line,