On monochrome displays, display the cursor in reverse video so that it's
authorben <ben@cda61777-01e9-0310-a592-d414129be87e>
Wed, 27 Apr 2005 21:42:51 +0000 (21:42 +0000)
committerben <ben@cda61777-01e9-0310-a592-d414129be87e>
Wed, 27 Apr 2005 21:42:51 +0000 (21:42 +0000)
visible on reversed out text.  This only applies to active block cursors for
now.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5698 cda61777-01e9-0310-a592-d414129be87e

unix/gtkwin.c

index 31d1331..f969b04 100644 (file)
@@ -1895,7 +1895,7 @@ void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
 
     nfg = ((monochrome ? ATTR_DEFFG : (attr & ATTR_FGMASK)) >> ATTR_FGSHIFT);
     nbg = ((monochrome ? ATTR_DEFBG : (attr & ATTR_BGMASK)) >> ATTR_BGSHIFT);
-    if (attr & ATTR_REVERSE) {
+    if (!!(attr & ATTR_REVERSE) ^ (monochrome && (attr & TATTR_ACTCURS))) {
        t = nfg;
        nfg = nbg;
        nbg = t;
@@ -1908,7 +1908,7 @@ void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
        if (nbg < 16) nbg |= 8;
        else if (nbg >= 256) nbg |= 1;
     }
-    if (attr & TATTR_ACTCURS) {
+    if ((attr & TATTR_ACTCURS) && !monochrome) {
        nfg = 260;
        nbg = 261;
     }