1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-10 23:58:06 -05:00

Disable true colour on monochrome or paletted displays.

I'm not sure if any X11 monochrome visuals or Windows paletted display
modes are still around, but just in case they are, we shouldn't
attempt true colour on either kind of display.
This commit is contained in:
Simon Tatham 2017-10-05 20:30:09 +01:00
parent 2f9738a282
commit 1adf211d70
2 changed files with 5 additions and 2 deletions

View File

@ -3255,6 +3255,9 @@ void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
} else
ncombining = 1;
if (monochrome)
truecolour.fg = truecolour.bg = optionalrgb_none;
nfg = ((monochrome ? ATTR_DEFFG : (attr & ATTR_FGMASK)) >> ATTR_FGSHIFT);
nbg = ((monochrome ? ATTR_DEFBG : (attr & ATTR_BGMASK)) >> ATTR_BGSHIFT);
if (!!(attr & ATTR_REVERSE) ^ (monochrome && (attr & TATTR_ACTCURS))) {

View File

@ -3522,12 +3522,12 @@ 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 (truecolour.fg.enabled)
if (!pal && truecolour.fg.enabled)
fg = RGB(truecolour.fg.r, truecolour.fg.g, truecolour.fg.b);
else
fg = colours[nfg];
if (truecolour.bg.enabled)
if (!pal && truecolour.bg.enabled)
bg = RGB(truecolour.bg.r, truecolour.bg.g, truecolour.bg.b);
else
bg = colours[nbg];