From e1429afe8b205c8cec466d7f439b2f14bc92736e Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 1 Mar 2002 22:40:20 +0000 Subject: [PATCH] (x_display_and_set_cursor): Blink box cursor using hollow box cursor. Blink bar cursor using 1 pixel wide bar. --- src/w32term.c | 21 +++++++++++++++++---- src/xterm.c | 16 +++++++++++++--- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/w32term.c b/src/w32term.c index 777ebd270e6..d4a071e30a0 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -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; diff --git a/src/xterm.c b/src/xterm.c index 82f98d9b7e4..a6a4e21a531 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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) -- 2.39.5