diff options
author | dumbbell <dumbbell@FreeBSD.org> | 2014-08-26 17:48:05 +0000 |
---|---|---|
committer | dumbbell <dumbbell@FreeBSD.org> | 2014-08-26 17:48:05 +0000 |
commit | 94c90531be379fe386d16f40f32c0ee231578a55 (patch) | |
tree | 85e9bf71deff5f89f142701347e05e8aa880c57b | |
parent | e934ec28fb865b0b119af6c407b33fdbeef68d3c (diff) | |
download | FreeBSD-src-94c90531be379fe386d16f40f32c0ee231578a55.zip FreeBSD-src-94c90531be379fe386d16f40f32c0ee231578a55.tar.gz |
vt(4): When creating a window buffer, fill it entirely
... not just the visible part.
This fixes a bug where, when switching from eg. vt_vga to vt_fb (ie. the
resolution goes up), the originally hidden, uninitialized area of the
buffer is displayed on the screen. This leads to a missing text cursor
when it's over an unitialized area.
This was also visible when selecting text: the uninitialized area was
not highlighted.
Internally, this area was zeroed: characters were all 0x00000000,
meaning the foreground and background color was black. Now, everything
is filled with a space with a gray foreground color, like the visible
area.
While here, remove the check for the mute flag and always use
TERMINAL_NORM_ATTR as the character attribute (ie. gray foreground,
black background).
MFC after: 1 week
-rw-r--r-- | sys/dev/vt/vt_buf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/vt/vt_buf.c b/sys/dev/vt/vt_buf.c index 80fcd48..1c76ea5a 100644 --- a/sys/dev/vt/vt_buf.c +++ b/sys/dev/vt/vt_buf.c @@ -410,9 +410,9 @@ vtbuf_init_early(struct vt_buf *vb) vtbuf_init_rows(vb); rect.tr_begin.tp_row = rect.tr_begin.tp_col = 0; - rect.tr_end = vb->vb_scr_size; - vtbuf_fill(vb, &rect, VTBUF_SPACE_CHAR((boothowto & RB_MUTE) == 0 ? - TERMINAL_KERN_ATTR : TERMINAL_NORM_ATTR)); + rect.tr_end.tp_col = vb->vb_scr_size.tp_col; + rect.tr_end.tp_row = vb->vb_history_size; + vtbuf_fill(vb, &rect, VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR)); vtbuf_make_undirty(vb); if ((vb->vb_flags & VBF_MTX_INIT) == 0) { mtx_init(&vb->vb_lock, "vtbuf", NULL, MTX_SPIN); |