changeset 54068:4dcd34f2c3a7

(get_window_cursor_type, display_and_set_cursor): Fix last change.
author Kim F. Storm <storm@cua.dk>
date Wed, 18 Feb 2004 21:01:50 +0000
parents b8f2a214f98f
children 39833fcaf41c 968e8c7ff1f4
files src/xdisp.c
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Wed Feb 18 21:00:59 2004 +0000
+++ b/src/xdisp.c	Wed Feb 18 21:01:50 2004 +0000
@@ -19029,9 +19029,9 @@
     cursor_type = get_specified_cursor_type (b->cursor_type, width);
 
   /* Use normal cursor if not blinked off.  */
-  if (!w->cursor_off_p && glyph != NULL)
-    {
-      if (glyph->type == IMAGE_GLYPH) {
+  if (!w->cursor_off_p)
+    {
+      if (glyph != NULL && glyph->type == IMAGE_GLYPH) {
 	if (cursor_type == FILLED_BOX_CURSOR)
 	  cursor_type = HOLLOW_BOX_CURSOR;
       }
@@ -19348,7 +19348,6 @@
   int new_cursor_type;
   int new_cursor_width;
   int active_cursor;
-  struct glyph_matrix *current_glyphs;
   struct glyph_row *glyph_row;
   struct glyph *glyph;
 
@@ -19366,11 +19365,7 @@
   if (!on && !w->phys_cursor_on_p)
     return;
 
-  current_glyphs = w->current_matrix;
-  glyph_row = MATRIX_ROW (current_glyphs, vpos);
-  glyph = (glyph_row->cursor_in_fringe_p ? NULL
-	   : glyph_row->glyphs[TEXT_AREA] + hpos);
-
+  glyph_row = MATRIX_ROW (w->current_matrix, vpos);
   /* If cursor row is not enabled, we don't really know where to
      display the cursor.  */
   if (!glyph_row->enabled_p)
@@ -19379,6 +19374,11 @@
       return;
     }
 
+  glyph = NULL;
+  if (!glyph_row->exact_window_width_line_p
+      || hpos < glyph_row->used[TEXT_AREA])
+    glyph = glyph_row->glyphs[TEXT_AREA] + hpos;
+
   xassert (interrupt_input_blocked);
 
   /* Set new_cursor_type to the cursor we want to be displayed.  */