]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
On monochrome displays, display the cursor in reverse video so that it's
authorBen Harris <bjh21@bjh21.me.uk>
Wed, 27 Apr 2005 21:42:51 +0000 (21:42 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
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.

[originally from svn r5698]

unix/gtkwin.c

index 31d1331909fcd7a842dc44ee214b2501a14ebddd..f969b046c1788ea57e01bf5720c9211e61b90d1b 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;
     }