From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 15:16:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09B90F7C; Thu, 6 Feb 2014 15:16:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E82581137; Thu, 6 Feb 2014 15:16:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16FGcjN087442; Thu, 6 Feb 2014 15:16:38 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16FGcC5087441; Thu, 6 Feb 2014 15:16:38 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201402061516.s16FGcC5087441@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 6 Feb 2014 15:16:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261553 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 15:16:39 -0000 Author: ray Date: Thu Feb 6 15:16:38 2014 New Revision: 261553 URL: http://svnweb.freebsd.org/changeset/base/261553 Log: Add vt_set_border function to help to change border color. Use vt_set_border to reset color after font changed (different font size may change border sizes) Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu Feb 6 15:12:44 2014 (r261552) +++ head/sys/dev/vt/vt_core.c Thu Feb 6 15:16:38 2014 (r261553) @@ -1045,6 +1045,30 @@ vt_change_font(struct vt_window *vw, str } static int +vt_set_border(struct vt_window *vw, struct vt_font *vf, term_color_t c) +{ + struct vt_device *vd = vw->vw_device; + int l, r, t, b, w, h; + + if (vd->vd_driver->vd_drawrect == NULL) + return (ENOTSUP); + + w = vd->vd_width - 1; + h = vd->vd_height - 1; + l = vd->vd_offset.tp_col - 1; + r = w - l; + t = vd->vd_offset.tp_row - 1; + b = h - t; + + vd->vd_driver->vd_drawrect(vd, 0, 0, w, t, 1, c); /* Top bar. */ + vd->vd_driver->vd_drawrect(vd, 0, t, l, b, 1, c); /* Left bar. */ + vd->vd_driver->vd_drawrect(vd, r, t, w, b, 1, c); /* Right bar. */ + vd->vd_driver->vd_drawrect(vd, 0, b, w, h, 1, c); /* Bottom bar. */ + + return (0); +} + +static int vt_proc_alive(struct vt_window *vw) { struct proc *p; @@ -1562,6 +1586,10 @@ skip_thunk: return (error); error = vt_change_font(vw, vf); + if (error == 0) { + /* XXX: replace 0 with current bg color. */ + vt_set_border(vw, vf, 0); + } vtfont_unref(vf); return (error); }