]> git.eshelyaron.com Git - emacs.git/commitdiff
(XTread_socket) <ConfigureNotify>:
authorKarl Heuer <kwzh@gnu.org>
Mon, 15 Mar 1999 19:53:32 +0000 (19:53 +0000)
committerKarl Heuer <kwzh@gnu.org>
Mon, 15 Mar 1999 19:53:32 +0000 (19:53 +0000)
If cursor pos is outside the new frame size, mark cursor as off.

src/xterm.c

index d562a3d2b1a2001239c00cbb7ffb99167dc33ebf..e4c4e62095f510bf7549efc423788d54981bb411 100644 (file)
@@ -4484,14 +4484,13 @@ XTread_socket (sd, bufp, numchars, expected)
              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 @@ XTread_socket (sd, bufp, numchars, expected)
                      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: