Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Aug 2014 17:08:38 +0000 (UTC)
From:      Jean-Sebastien Pedron <dumbbell@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r270589 - head/sys/dev/vt
Message-ID:  <201408251708.s7PH8cTp011701@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dumbbell
Date: Mon Aug 25 17:08:38 2014
New Revision: 270589
URL: http://svnweb.freebsd.org/changeset/base/270589

Log:
  vt(4): The cursor coordinates are relative to the drawn area
  
  ... not the whole screen. Don't use font offsets in
  vt_mark_mouse_position_as_dirty().
  
  This fixes a bug where the mouse position wasn't marked as dirty when
  approaching the borders of the drawn 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	Mon Aug 25 17:06:18 2014	(r270588)
+++ head/sys/dev/vt/vt_core.c	Mon Aug 25 17:08:38 2014	(r270589)
@@ -860,16 +860,12 @@ vt_mark_mouse_position_as_dirty(struct v
 	y = vd->vd_my_drawn;
 
 	if (vf != NULL) {
-		area.tr_begin.tp_col = (x - vw->vw_offset.tp_col) /
-		    vf->vf_width;
-		area.tr_begin.tp_row = (y - vw->vw_offset.tp_row) /
-		    vf->vf_height;
+		area.tr_begin.tp_col = x / vf->vf_width;
+		area.tr_begin.tp_row = y / vf->vf_height;
 		area.tr_end.tp_col =
-		    ((x + vd->vd_mcursor->width - vw->vw_offset.tp_col) /
-		     vf->vf_width) + 1;
+		    ((x + vd->vd_mcursor->width) / vf->vf_width) + 1;
 		area.tr_end.tp_row =
-		    ((y + vd->vd_mcursor->height - vw->vw_offset.tp_row) /
-		     vf->vf_height) + 1;
+		    ((y + vd->vd_mcursor->height) / vf->vf_height) + 1;
 	} else {
 		/*
 		 * No font loaded (ie. vt_vga operating in textmode).



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