From: ben Date: Wed, 27 Apr 2005 21:09:45 +0000 (+0000) Subject: On 1bpp displays, ignore colour attributes. This makes pterm minimally useful X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/6800a371a4f9285a55a713d2c25725e6b68dd701 On 1bpp displays, ignore colour attributes. This makes pterm minimally useful 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. git-svn-id: svn://svn.tartarus.org/sgt/putty@5696 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/unix/gtkwin.c b/unix/gtkwin.c index 9838250f..a5713852 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -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;