Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Apr 2014 14:19:32 +0000 (UTC)
From:      Aleksandr Rybalko <ray@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r264612 - stable/9/sys/dev/vt
Message-ID:  <201404171419.s3HEJW2a075496@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ray
Date: Thu Apr 17 14:19:32 2014
New Revision: 264612
URL: http://svnweb.freebsd.org/changeset/base/264612

Log:
  MFC r264258
  
  Fix cursor color in reverse video mode.
  
  Sponsored by:	The FreeBSD Foundation

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

Modified: stable/9/sys/dev/vt/vt_core.c
==============================================================================
--- stable/9/sys/dev/vt/vt_core.c	Thu Apr 17 14:18:30 2014	(r264611)
+++ stable/9/sys/dev/vt/vt_core.c	Thu Apr 17 14:19:32 2014	(r264612)
@@ -652,24 +652,26 @@ static inline void
 vt_determine_colors(term_char_t c, int cursor,
     term_color_t *fg, term_color_t *bg)
 {
+	term_color_t tmp;
+	int invert;
+
+	invert = 0;
 
 	*fg = TCHAR_FGCOLOR(c);
 	if (TCHAR_FORMAT(c) & TF_BOLD)
 		*fg = TCOLOR_LIGHT(*fg);
 	*bg = TCHAR_BGCOLOR(c);
 
-	if (TCHAR_FORMAT(c) & TF_REVERSE) {
-		term_color_t tmp;
+	if (TCHAR_FORMAT(c) & TF_REVERSE)
+		invert ^= 1;
+	if (cursor)
+		invert ^= 1;
 
+	if (invert) {
 		tmp = *fg;
 		*fg = *bg;
 		*bg = tmp;
 	}
-
-	if (cursor) {
-		*fg = *bg;
-		*bg = TC_WHITE;
-	}
 }
 
 static void



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