# HG changeset patch # User Richard M. Stallman # Date 761533311 0 # Node ID 040bdc2fec7cb2faabd3a0a3e8525c150426a42b # Parent fdb3959bbaf78e4eb21e885628075fb3b198785b (dumpglyphs): Try various alternatives for foreground color of a glyph with the cursor on it. diff -r fdb3959bbaf7 -r 040bdc2fec7c src/xterm.c --- a/src/xterm.c Thu Feb 17 23:33:02 1994 +0000 +++ b/src/xterm.c Fri Feb 18 01:01:51 1994 +0000 @@ -569,7 +569,25 @@ unsigned long mask; xgcv.background = f->display.x->cursor_pixel; - xgcv.foreground = f->display.x->cursor_foreground_pixel; + if (face == FRAME_DEFAULT_FACE (f)) + xgcv.foreground = f->display.x->cursor_foreground_pixel; + else + xgcv.foreground = face->foreground; + /* If the glyph would be invisible, + try a different foreground. */ + if (xgcv.foreground == xgcv.background) + xgcv.foreground = face->background; + if (xgcv.foreground == xgcv.background) + xgcv.foreground = f->display.x->cursor_foreground_pixel; + if (xgcv.foreground == xgcv.background) + xgcv.foreground = face->foreground; + /* Make sure the cursor is distinct from text in this face. */ + if (xgcv.background == face->background + && xgcv.foreground == face->foreground) + { + xgcv.background = face->foreground; + xgcv.foreground = face->background; + } xgcv.font = face->font->fid; xgcv.graphics_exposures = 0; mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures;