From owner-svn-src-head@FreeBSD.ORG Wed Aug 27 17:16:53 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 2AF0CBB3; Wed, 27 Aug 2014 17:16:53 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15D763024; Wed, 27 Aug 2014 17:16:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7RHGqgk077538; Wed, 27 Aug 2014 17:16:52 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7RHGq4r077537; Wed, 27 Aug 2014 17:16:52 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201408271716.s7RHGq4r077537@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Wed, 27 Aug 2014 17:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270721 - 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.18-1 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: Wed, 27 Aug 2014 17:16:53 -0000 Author: dumbbell Date: Wed Aug 27 17:16:52 2014 New Revision: 270721 URL: http://svnweb.freebsd.org/changeset/base/270721 Log: vt(4): If the terminal shrinks, make sure the mouse is inside the new area MFC after: 1 week Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed Aug 27 15:10:28 2014 (r270720) +++ head/sys/dev/vt/vt_core.c Wed Aug 27 17:16:52 2014 (r270721) @@ -1381,9 +1381,20 @@ vt_change_font(struct vt_window *vw, str */ vtfont_unref(vw->vw_font); vw->vw_font = vtfont_ref(vf); - vt_compute_drawable_area(vw); } + /* + * Compute the drawable area and move the mouse cursor inside + * it, in case the new area is smaller than the previous one. + */ + vt_compute_drawable_area(vw); + vd->vd_mx = min(vd->vd_mx, + vw->vw_draw_area.tr_end.tp_col - + vw->vw_draw_area.tr_begin.tp_col - 1); + vd->vd_my = min(vd->vd_my, + vw->vw_draw_area.tr_end.tp_row - + vw->vw_draw_area.tr_begin.tp_row - 1); + /* Force a full redraw the next timer tick. */ if (vd->vd_curwindow == vw) { vt_set_border(vw, vf, TC_BLACK); @@ -2272,8 +2283,8 @@ vt_resize(struct vt_device *vd) if (!(vd->vd_flags & VDF_TEXTMODE) && vw->vw_font == NULL) vw->vw_font = vtfont_ref(&vt_font_default); VT_UNLOCK(vd); + /* Resize terminal windows */ - vt_compute_drawable_area(vw); while (vt_change_font(vw, vw->vw_font) == EBUSY) { DPRINTF(100, "%s: vt_change_font() is busy, " "window %d\n", __func__, i);