From 376ec65578576f6ff955373ea68539b57d23a012 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 8 Jul 2025 16:28:37 -0400 Subject: kernel: cons: Use glyph relative pos in cons attr - Make curs_col/curs_row reference console_attr.cursor_x/cursor_y - Console cursor x/y attributes reflect x/y multiplied by glyph dimensions Signed-off-by: Ian Moffett --- sys/dev/cons/cons.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/dev/cons/cons.c') diff --git a/sys/dev/cons/cons.c b/sys/dev/cons/cons.c index 5a59e3d..7407ec1 100644 --- a/sys/dev/cons/cons.c +++ b/sys/dev/cons/cons.c @@ -500,17 +500,17 @@ ctl_attr_write(struct ctlfs_dev *cdp, struct sio_txn *sio) sio->len = sizeof(*attrp); } - memcpy(attrp, sio->buf, sio->len); spinlock_acquire(&scr->lock); + HIDE_CURSOR(scr); + memcpy(attrp, sio->buf, sio->len); /* Clip the x/y positions */ if (attrp->cursor_x >= scr->ncols) - attrp->cursor_x = scr->ncols - 1; + attrp->cursor_x = scr->ncols - FONT_WIDTH; if (attrp->cursor_y >= scr->nrows) - attrp->cursor_y = scr->nrows - 1; + attrp->cursor_y = scr->nrows - FONT_HEIGHT; /* Update cursor */ - HIDE_CURSOR(scr); scr->curs_col = attrp->cursor_x; scr->curs_row = attrp->cursor_y; scr->ch_col = attrp->cursor_x; -- cgit v1.2.3