]> git.eshelyaron.com Git - emacs.git/commitdiff
(x_display_and_set_cursor): Blink box cursor using
authorKim F. Storm <storm@cua.dk>
Fri, 1 Mar 2002 22:40:20 +0000 (22:40 +0000)
committerKim F. Storm <storm@cua.dk>
Fri, 1 Mar 2002 22:40:20 +0000 (22:40 +0000)
hollow box cursor.  Blink bar cursor using 1 pixel wide bar.

src/w32term.c
src/xterm.c

index 777ebd270e646978c621ff2d43d5309e29e757a1..d4a071e30a070d1fa2afdd384433901562defddc 100644 (file)
@@ -9759,8 +9759,6 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
           else
             new_cursor_type = HOLLOW_BOX_CURSOR;
         }
-      else if (w->cursor_off_p)
-        new_cursor_type = NO_CURSOR;
       else
         {
          struct buffer *b = XBUFFER (w->buffer);
@@ -9770,6 +9768,15 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
          else
            new_cursor_type = x_specified_cursor_type (b->cursor_type, 
                                                       &new_cursor_width);
+         if (w->cursor_off_p)
+           {
+             if (new_cursor_type == FILLED_BOX_CURSOR)
+               new_cursor_type = HOLLOW_BOX_CURSOR;
+             else if (new_cursor_type == BAR_CURSOR && new_cursor_width > 1)
+               new_cursor_width = 1;
+             else
+               new_cursor_type = NO_CURSOR;
+           }
        }
     }
 
@@ -9780,7 +9787,9 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
       && (!on
          || w->phys_cursor.x != x
          || w->phys_cursor.y != y
-         || new_cursor_type != w->phys_cursor_type))
+         || new_cursor_type != w->phys_cursor_type)
+         || (new_cursor_type == BAR_CURSOR
+             && new_cursor_width != w->phys_cursor_width)))
     x_erase_phys_cursor (w);
 
   /* If the cursor is now invisible and we want it to be visible,
@@ -9805,9 +9814,13 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
            x_erase_phys_cursor (w);
 
          new_cursor_type = w->phys_cursor_type = NO_CURSOR;
+         w->phys_cursor_width = -1;
        }
       else
-       w->phys_cursor_type = new_cursor_type;
+       {
+         w->phys_cursor_type = new_cursor_type;
+         w->phys_cursor_width = new_cursor_width;
+       }
 
       w->phys_cursor_on_p = 1;
 
index 82f98d9b7e43e9f6d8ab8de92a34fe6b58375887..a6a4e21a531b080851192597f23976126665b3c2 100644 (file)
@@ -11640,8 +11640,6 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
          else
            new_cursor_type = HOLLOW_BOX_CURSOR;
        }
-      else if (w->cursor_off_p)
-       new_cursor_type = NO_CURSOR;
       else
        {
          struct buffer *b = XBUFFER (w->buffer);
@@ -11651,6 +11649,15 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
          else
            new_cursor_type = x_specified_cursor_type (b->cursor_type, 
                                                       &new_cursor_width);
+         if (w->cursor_off_p)
+           {
+             if (new_cursor_type == FILLED_BOX_CURSOR)
+               new_cursor_type = HOLLOW_BOX_CURSOR;
+             else if (new_cursor_type == BAR_CURSOR && new_cursor_width > 1)
+               new_cursor_width = 1;
+             else
+               new_cursor_type = NO_CURSOR;
+           }
        }
     }
 
@@ -11661,7 +11668,9 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
       && (!on
          || w->phys_cursor.x != x
          || w->phys_cursor.y != y
-         || new_cursor_type != w->phys_cursor_type))
+         || new_cursor_type != w->phys_cursor_type
+         || (new_cursor_type == BAR_CURSOR
+             && new_cursor_width != w->phys_cursor_width)))
     x_erase_phys_cursor (w);
 
   /* If the cursor is now invisible and we want it to be visible,
@@ -11678,6 +11687,7 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
       w->phys_cursor.hpos = hpos;
       w->phys_cursor.vpos = vpos;
       w->phys_cursor_type = new_cursor_type;
+      w->phys_cursor_width = new_cursor_width;
       w->phys_cursor_on_p = 1;
 
       switch (new_cursor_type)