diff options
author | dumbbell <dumbbell@FreeBSD.org> | 2014-08-27 15:10:28 +0000 |
---|---|---|
committer | dumbbell <dumbbell@FreeBSD.org> | 2014-08-27 15:10:28 +0000 |
commit | 0305dad6ea32064a43f1782be848ade1e42edfeb (patch) | |
tree | 7880ddafd1e06b915c0b5262fcb09a9a16227289 /sys/dev/vt/hw/fb/vt_fb.c | |
parent | 387f5b6c1a118a05d299878c1c40d2cfb87f5652 (diff) | |
download | FreeBSD-src-0305dad6ea32064a43f1782be848ade1e42edfeb.zip FreeBSD-src-0305dad6ea32064a43f1782be848ade1e42edfeb.tar.gz |
vt(4): Fix mouse cursor handling in vt_fb/creator_vt/ofwfb
There were two issues:
1. The area given to vt_is_cursor_in_area() was adding the drawable
area offset, something already handled by this function.
2. The cursor was shifted on the screen by the offset of this area
and thus was misplaced or not erased. Furthermore, when reaching
the bottom or right borders, the cursor was either totally
removed or not erased correctly.
MFC after: 1 week
Diffstat (limited to 'sys/dev/vt/hw/fb/vt_fb.c')
-rw-r--r-- | sys/dev/vt/hw/fb/vt_fb.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/sys/dev/vt/hw/fb/vt_fb.c b/sys/dev/vt/hw/fb/vt_fb.c index 3cae588..ddec76d 100644 --- a/sys/dev/vt/hw/fb/vt_fb.c +++ b/sys/dev/vt/hw/fb/vt_fb.c @@ -263,17 +263,16 @@ vt_fb_bitblt_bitmap(struct vt_device *vd, const struct vt_window *vw, b = m = 0; bpl = (width + 7) >> 3; /* Bytes per source line. */ - /* Don't try to put off screen pixels */ - if (((x + width) > info->fb_width) || ((y + height) > - info->fb_height)) - return; - KASSERT((info->fb_vbase != 0), ("Unmapped framebuffer")); line = (info->fb_stride * y) + (x * bpp); - for (l = 0; l < height; l++) { + for (l = 0; + l < height && y + l < vw->vw_draw_area.tr_end.tp_row; + l++) { ch = pattern; - for (c = 0; c < width; c++) { + for (c = 0; + c < width && x + c < vw->vw_draw_area.tr_end.tp_col; + c++) { if (c % 8 == 0) b = *ch++; else @@ -353,20 +352,17 @@ vt_fb_bitblt_text(struct vt_device *vd, const struct vt_window *vw, term_rect_t drawn_area; - drawn_area.tr_begin.tp_col = area->tr_begin.tp_col * vf->vf_width + - vw->vw_draw_area.tr_begin.tp_col; - drawn_area.tr_begin.tp_row = area->tr_begin.tp_row * vf->vf_height + - vw->vw_draw_area.tr_begin.tp_row; - drawn_area.tr_end.tp_col = area->tr_end.tp_col * vf->vf_width + - vw->vw_draw_area.tr_begin.tp_col; - drawn_area.tr_end.tp_row = area->tr_end.tp_row * vf->vf_height + - vw->vw_draw_area.tr_begin.tp_row; + drawn_area.tr_begin.tp_col = area->tr_begin.tp_col * vf->vf_width; + drawn_area.tr_begin.tp_row = area->tr_begin.tp_row * vf->vf_height; + drawn_area.tr_end.tp_col = area->tr_end.tp_col * vf->vf_width; + drawn_area.tr_end.tp_row = area->tr_end.tp_row * vf->vf_height; if (vt_is_cursor_in_area(vd, &drawn_area)) { vt_fb_bitblt_bitmap(vd, vw, vd->vd_mcursor->map, vd->vd_mcursor->mask, vd->vd_mcursor->width, vd->vd_mcursor->height, - vd->vd_mx_drawn, vd->vd_my_drawn, + vd->vd_mx_drawn + vw->vw_draw_area.tr_begin.tp_col, + vd->vd_my_drawn + vw->vw_draw_area.tr_begin.tp_row, vd->vd_mcursor_fg, vd->vd_mcursor_bg); } #endif |