changeset 24489:abf5b4802f9b

(XTread_socket) <ConfigureNotify>: If cursor pos is outside the new frame size, mark cursor as off.
author Karl Heuer <kwzh@gnu.org>
date Mon, 15 Mar 1999 19:53:32 +0000
parents a8e006544aa5
children 7a5f7af21c27
files src/xterm.c
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Mon Mar 15 15:20:56 1999 +0000
+++ b/src/xterm.c	Mon Mar 15 19:53:32 1999 +0000
@@ -4484,14 +4484,13 @@
 	      f = x_top_window_to_frame (dpyinfo, event.xconfigure.window);
 	      if (f)
 		{
+		  int rows = PIXEL_TO_CHAR_HEIGHT (f, event.xconfigure.height);
+		  int columns = PIXEL_TO_CHAR_WIDTH (f, event.xconfigure.width);
 #ifndef USE_X_TOOLKIT
 		  /* In the toolkit version, change_frame_size
 		     is called by the code that handles resizing
 		     of the EmacsFrame widget.  */
 
-		  int rows = PIXEL_TO_CHAR_HEIGHT (f, event.xconfigure.height);
-		  int columns = PIXEL_TO_CHAR_WIDTH (f, event.xconfigure.width);
-
 		  /* Even if the number of character rows and columns has
 		     not changed, the font size may have changed, so we need
 		     to check the pixel dimensions as well.  */
@@ -4531,7 +4530,16 @@
 		      event.xconfigure.y = f->output_data.x->widget->core.y;
 		    }
 #endif
+		  /* If cursor was outside the new size, mark it as off.  */
+		  if (f->phys_cursor_y >= rows
+		      || f->phys_cursor_x >= columns)
+		    {
+		      f->phys_cursor_x = 0;
+		      f->phys_cursor_y = 0;
+		      f->phys_cursor_on = 0;
+		    }
 		}
+
 	      goto OTHER;
 
 	    case ButtonPress: