summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>2000-02-11 01:19:44 +0000
committeryokota <yokota@FreeBSD.org>2000-02-11 01:19:44 +0000
commitad45d3253bd73e1c56c3e944b5ac64fd4e356470 (patch)
tree8a3a8baa635aae38bb249e7e58e4bae96f311e9d /sys/dev
parent6606faa5d72baa856984bd6654014c13364bfd63 (diff)
downloadFreeBSD-src-ad45d3253bd73e1c56c3e944b5ac64fd4e356470.zip
FreeBSD-src-ad45d3253bd73e1c56c3e944b5ac64fd4e356470.tar.gz
- 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
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/syscons/scterm-sc.c4
-rw-r--r--sys/dev/syscons/syscons.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/syscons/scterm-sc.c b/sys/dev/syscons/scterm-sc.c
index f11cd27..6c5bfa8 100644
--- a/sys/dev/syscons/scterm-sc.c
+++ b/sys/dev/syscons/scterm-sc.c
@@ -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 */
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index b648cfb..af242b3 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -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;
}
OpenPOWER on IntegriCloud