]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
On 1bpp displays, ignore colour attributes. This makes pterm minimally useful
authorBen Harris <bjh21@bjh21.me.uk>
Wed, 27 Apr 2005 21:09:45 +0000 (21:09 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Wed, 27 Apr 2005 21:09:45 +0000 (21:09 +0000)
there, though (e.g.) switching to using reverse video for the cursor would
probably also help.  Displays with other silly depths (e.g. 2bpp) aren't
catered for, but I suspect they're rare in the X world.

[originally from svn r5696]

unix/gtkwin.c

index 9838250fe194041965ad7df92450444e481694f9..a5713852ff6d420d2d525c6e91d3c63078d153d9 100644 (file)
@@ -1885,6 +1885,7 @@ void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
     GdkGC *gc = dctx->gc;
     int ncombining, combining;
     int nfg, nbg, t, fontid, shadow, rlen, widefactor;
+    int monochrome = gtk_widget_get_visual(dctx->inst->area)->depth == 1;
 
     if (attr & TATTR_COMBINING) {
        ncombining = len;
@@ -1892,8 +1893,8 @@ void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
     } else
        ncombining = 1;
 
-    nfg = ((attr & ATTR_FGMASK) >> ATTR_FGSHIFT);
-    nbg = ((attr & ATTR_BGMASK) >> ATTR_BGSHIFT);
+    nfg = ((monochrome ? ATTR_DEFFG : (attr & ATTR_FGMASK)) >> ATTR_FGSHIFT);
+    nbg = ((monochrome ? ATTR_DEFBG : (attr & ATTR_BGMASK)) >> ATTR_BGSHIFT);
     if (attr & ATTR_REVERSE) {
        t = nfg;
        nfg = nbg;