Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 May 2017 23:52:28 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r318506 - stable/11/sys/dev/vt
Message-ID:  <201705182352.v4INqSbQ099301@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Thu May 18 23:52:28 2017
New Revision: 318506
URL: https://svnweb.freebsd.org/changeset/base/318506

Log:
  MFC:	r317171, r317173, r317560, r317561, r318326
  
  Always clear borders when the terminal is flushed.
  
  PR:		202288

Modified:
  stable/11/sys/dev/vt/vt_core.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/vt/vt_core.c
==============================================================================
--- stable/11/sys/dev/vt/vt_core.c	Thu May 18 23:41:34 2017	(r318505)
+++ stable/11/sys/dev/vt/vt_core.c	Thu May 18 23:52:28 2017	(r318506)
@@ -1147,6 +1147,36 @@ vt_mark_mouse_position_as_dirty(struct v
 }
 #endif
 
+static void
+vt_set_border(struct vt_device *vd, const term_rect_t *area,
+    const term_color_t c)
+{
+	vd_drawrect_t *drawrect = vd->vd_driver->vd_drawrect;
+
+	if (drawrect == NULL)
+		return;
+
+	/* Top bar */
+	if (area->tr_begin.tp_row > 0)
+		drawrect(vd, 0, 0, vd->vd_width - 1,
+		    area->tr_begin.tp_row - 1, 1, c);
+
+	/* Left bar */
+	if (area->tr_begin.tp_col > 0)
+		drawrect(vd, 0, area->tr_begin.tp_row,
+		    area->tr_begin.tp_col - 1, area->tr_end.tp_row - 1, 1, c);
+
+	/* Right bar */
+	if (area->tr_end.tp_col < vd->vd_width)
+		drawrect(vd, area->tr_end.tp_col, area->tr_begin.tp_row,
+		    vd->vd_width - 1, area->tr_end.tp_row - 1, 1, c);
+
+	/* Bottom bar */
+	if (area->tr_end.tp_row < vd->vd_height)
+		drawrect(vd, 0, area->tr_end.tp_row, vd->vd_width - 1,
+		    vd->vd_height - 1, 1, c);
+}
+
 static int
 vt_flush(struct vt_device *vd)
 {
@@ -1212,6 +1242,7 @@ vt_flush(struct vt_device *vd)
 	if (vd->vd_flags & VDF_INVALID) {
 		vd->vd_flags &= ~VDF_INVALID;
 
+		vt_set_border(vd, &vw->vw_draw_area, TC_BLACK);
 		vt_termrect(vd, vf, &tarea);
 		if (vt_draw_logo_cpus)
 			vtterm_draw_cpu_logos(vd);
@@ -1527,45 +1558,6 @@ vtterm_opened(struct terminal *tm, int o
 }
 
 static int
-vt_set_border(struct vt_window *vw, term_color_t c)
-{
-	struct vt_device *vd = vw->vw_device;
-
-	if (vd->vd_driver->vd_drawrect == NULL)
-		return (ENOTSUP);
-
-	/* Top bar. */
-	if (vw->vw_draw_area.tr_begin.tp_row > 0)
-		vd->vd_driver->vd_drawrect(vd,
-		    0, 0,
-		    vd->vd_width - 1, vw->vw_draw_area.tr_begin.tp_row - 1,
-		    1, c);
-
-	/* Left bar. */
-	if (vw->vw_draw_area.tr_begin.tp_col > 0)
-		vd->vd_driver->vd_drawrect(vd,
-		    0, 0,
-		    vw->vw_draw_area.tr_begin.tp_col - 1, vd->vd_height - 1,
-		    1, c);
-
-	/* Right bar. */
-	if (vw->vw_draw_area.tr_end.tp_col < vd->vd_width)
-		vd->vd_driver->vd_drawrect(vd,
-		    vw->vw_draw_area.tr_end.tp_col - 1, 0,
-		    vd->vd_width - 1, vd->vd_height - 1,
-		    1, c);
-
-	/* Bottom bar. */
-	if (vw->vw_draw_area.tr_end.tp_row < vd->vd_height)
-		vd->vd_driver->vd_drawrect(vd,
-		    0, vw->vw_draw_area.tr_end.tp_row - 1,
-		    vd->vd_width - 1, vd->vd_height - 1,
-		    1, c);
-
-	return (0);
-}
-
-static int
 vt_change_font(struct vt_window *vw, struct vt_font *vf)
 {
 	struct vt_device *vd = vw->vw_device;
@@ -1630,7 +1622,6 @@ vt_change_font(struct vt_window *vw, str
 
 	/* Force a full redraw the next timer tick. */
 	if (vd->vd_curwindow == vw) {
-		vt_set_border(vw, TC_BLACK);
 		vd->vd_flags |= VDF_INVALID;
 		vt_resume_flush_timer(vw->vw_device, 0);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705182352.v4INqSbQ099301>