- Fix text cursor logic so that multiple instances of the "normal" cursor

won't appear on the screen, and "blinking" and "destructive" cursor
  won't appear in the vty for which the text cursor is currently hidden.

Approved by: jkh
This commit is contained in:
Kazutaka YOKOTA 2000-02-11 01:19:44 +00:00
parent dda7c8e323
commit ade2307229
2 changed files with 7 additions and 5 deletions

View File

@ -506,6 +506,7 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
break;
case 'C': /* set cursor type & shape */
i = spltty();
if (!ISGRAPHSC(sc->cur_scp))
sc_remove_cursor_image(sc->cur_scp);
if (tcp->num_param == 1) {
@ -528,11 +529,10 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
* are affected. Update the cursor in the current console...
*/
if (!ISGRAPHSC(sc->cur_scp)) {
i = spltty();
sc_set_cursor_image(sc->cur_scp);
sc_draw_cursor_image(sc->cur_scp);
splx(i);
}
splx(i);
break;
case 'F': /* set ansi foreground */

View File

@ -718,6 +718,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case CONS_CURSORTYPE: /* set cursor type blink/noblink */
s = spltty();
if (!ISGRAPHSC(sc->cur_scp))
sc_remove_cursor_image(sc->cur_scp);
if ((*(int*)data) & 0x01)
@ -733,11 +734,10 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
* are affected. Update the cursor in the current console...
*/
if (!ISGRAPHSC(sc->cur_scp)) {
s = spltty();
sc_set_cursor_image(sc->cur_scp);
sc_draw_cursor_image(sc->cur_scp);
splx(s);
}
splx(s);
return 0;
case CONS_BELLTYPE: /* set bell type sound/visual */
@ -1791,7 +1791,6 @@ scrn_update(scr_stat *scp, int show_cursor)
scp->cursor_oldpos > scp->end) {
sc_remove_cursor_image(scp);
}
scp->cursor_oldpos = scp->cursor_pos;
sc_draw_cursor_image(scp);
}
else {
@ -2335,6 +2334,8 @@ exchange_scr(sc_softc_t *sc)
/* save the current state of video and keyboard */
sc_move_cursor(sc->old_scp, sc->old_scp->xpos, sc->old_scp->ypos);
if (!ISGRAPHSC(sc->old_scp))
sc_remove_cursor_image(sc->old_scp);
if (sc->old_scp->kbd_mode == K_XLATE)
save_kbd_state(sc->old_scp);
@ -2386,6 +2387,7 @@ sc_draw_cursor_image(scr_stat *scp)
(*scp->rndr->draw_cursor)(scp, scp->cursor_pos,
scp->sc->flags & SC_BLINK_CURSOR, TRUE,
sc_inside_cutmark(scp, scp->cursor_pos));
scp->cursor_oldpos = scp->cursor_pos;
--scp->sc->videoio_in_progress;
}